戻る

プログラムで各テーブルを個別に読む

0001: ####################################################################
0002: # プログラムが自前で順次4つのテーブルを読む
0003: my($t1)=&Time::HiRes::time();
0004: my($trans);
0005: &startTransaction(\$DB, \$trans);
0006: my(%khash);
0007: if ($pvalue{FAMLY}=~/[a-z]/){
0008:     %khash=(FAMILYNAME=>$pvalue{FAMLY});
0009: }else{
0010:     %khash=(FAMILYJPN=>$pvalue{FAMLY});
0011: }
0012: my(%fhash)=&selectOneLine(\$trans, \ "FAMILY", \%khash);
0013: %khash=(ORDERNAME=>$fhash{ORDERNAME});
0014: my(%ohash)=&selectOneLine(\$trans, \ "ORDERTAB", \%khash);
0015: my(%khash)=(FAMILYNAME=>$fhash{FAMILYNAME});
0016: my($gstate)=&selectRows(\$trans, \ "GENUS", \%khash);
0017: my(%ghash);
0018: my($c)=0;
0019: print("fetch by program ---");
0020: while ($gstate->fetch(\%ghash)==0){
0021:     %khash=(GENUSNAME=>$ghash{GENUSNAME});
0022:     my($sstate)=&selectRows(\$trans, \ "SPECIES", \%khash);
0023:     my(%shash);
0024:     while ($sstate->fetch(\%shash)==0){
0025:         $c++;
0026:     }
0027: }
0028: &commitTransaction(\$trans);
0029: my($t2)=&Time::HiRes::time();
0030: printf("Select:%4d rows Elapsed:%8.3f msec\n", $c, ($t2-$t1)*1000);

この HTML を検査する。( XHTML 1.0 Strict で書かれています )
Another HTML Lint Gateway ( Mirrored by htmllint.oosato.org )