2 ## This script allows you to export a rel_2_2 bibliographic db in
3 #MARC21 format from the command line.
10 use C4::Interface::CGI::Output;
11 use C4::Output; # contains gettemplate
15 my $outfile = $ARGV[0];
16 open(OUT,">$outfile") or die $!;
18 my $start_bib = $query->param("start_bib");
19 my $end_bib = $query->param("end_bib");
20 my $dbh=C4::Context->dbh;
22 if ($start_bib && $end_bib) {
23 $sth=$dbh->prepare("select bibid from marc_biblio where bibid >=? and bibid <=? order by bibid");
24 $sth->execute($start_bib,$end_bib);
26 $sth=$dbh->prepare("select bibid from marc_biblio order by bibid");
29 while (my ($bibid) = $sth->fetchrow) {
30 my $record = MARCgetbiblio($dbh,$bibid);
32 print OUT $record->as_usmarc();