Koha/marc/koha2marc
tonnesen cb7441a537 More merges in from rel-1-2
All of the changes so far have been minor.  I did uncomment delbiblio($biblio)
in delbiblio.pl in the main branch to match delbiblio.pl in rel-1-2
2002-06-20 17:33:07 +00:00

39 lines
1 KiB
Perl

#!/usr/bin/perl
# CAREFUL!!!!
# This next line deletes _ALL_ of the existing MARC data from the
# MySQL tables!!! It is only in here during development!!!!
system("mysql Koha -pkohapass < deletemarc");
use C4::Database;
use C4::Catalogue;
use CGI;
use DBI;
#use strict;
use C4::Acquisitions;
use C4::Biblio;
use C4::Output;
my $dbh=C4Connect;
my $userid=$ENV{'REMOTE_USER'};
my $dbh=C4Connect;
my $sth=$dbh->prepare("select * from biblio,biblioitems where biblio.biblionumber=biblioitems.biblionumber");
$sth->execute;
my $env;
$env->{'marconly'}=1;
while (my $biblioitem=$sth->fetchrow_hashref) {
print "Processing $biblioitem->{'title'}\n";
my $Record_ID;
($env, $Record_ID) = newBiblioItem($env,$biblioitem);
my $sti=$dbh->prepare("select * from items,biblioitems where items.biblioitemnumber=biblioitems.biblioitemnumber and biblioitems.biblioitemnumber=$biblioitem->{'biblioitemnumber'}");
$sti->execute;
while (my $item=$sti->fetchrow_hashref) {
newItem($env, $Record_ID, $item);
}
}