4 # Benchmark script for Paul's marc db schema using split() to separate subfield
5 # code from subfield value
10 my $dbh=DBI->connect("dbi:mysql:kohabenchmark", 'youruserid', 'yourpassword');
18 for ($i=0; $i<$count; $i++) {
19 ($bibid) || ($bibid=int(rand(79998))+1);
21 ($print) && (print "BIBID: $bibid\n");
22 my $sth=$dbh->prepare("select tagnumber,tagvalue from marc_0XX_tag_table where bibcode=$bibid order by tagorder");
24 while (my ($tagnumber, $tagvalue) = $sth->fetchrow) {
25 ($print) && (print " Tag: $tagnumber\n");
26 foreach (split(/\0/, $tagvalue)) {
27 my ($code, $value) = split(/\s/, $_, 2);
28 ($print) && (print " $code $value\n");