From 4285d166ca37713d5dccd2243beb389bb27ba917 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Mon, 25 Jun 2001 18:55:28 +0000 Subject: [PATCH] Perl script to convert existing Koha tables to the new MARC tables. --- marc/koha2marc | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 marc/koha2marc diff --git a/marc/koha2marc b/marc/koha2marc new file mode 100644 index 0000000000..df31930505 --- /dev/null +++ b/marc/koha2marc @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +# TODO +# add subtitle entry to marcimport (for stewelm) +# swap illustrator and additional authors for marcimport.pl +# fix replacement price entry (always coming up as zero) +# Check serial title when determining if biblio already exists + + +my $lc1='#dddddd'; +my $lc2='#ddaaaa'; + + +system("mysql Koha -ptestpass < deletemarc"); + +use C4::Database; +use C4::Catalogue; +use CGI; +use DBI; +#use strict; +use C4::Acquisitions; +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; + +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); + } +} -- 2.39.2