From 12bfd669958ada08b4f591f48867bc1fc0ee1849 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 3 May 2004 09:19:22 +0000 Subject: [PATCH] some fixes for mysql prepare & execute --- C4/Biblio.pm | 233 ++++++++++++++++++++++++++------------------------- 1 file changed, 118 insertions(+), 115 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ce1b5f239d..5c6ee7baed 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1270,7 +1270,7 @@ sub OLDmodsubject { # so insert into cataloguentry so its in auth file my $sth2 = $dbh->prepare("Insert into catalogueentry (entrytype,catalogueentry) values ('s',?)"); - $sth2->execute($subject[$i]); + $sth2->execute($subject[$i]) if ($subject[$i]); $sth2->finish; } else { $error = "$subject[$i]\n does not exist in the subject authority file"; @@ -1288,10 +1288,10 @@ sub OLDmodsubject { my $sth = $dbh->prepare("Delete from bibliosubject where biblionumber = ?"); $sth->execute($bibnum); $sth->finish; - $sth = $dbh->prepare("Insert into bibliosubject values (?,?)"); + $sth = $dbh->prepare("Insert into bibliosubject (subject,biblionumber) values (?,?)"); my $query; foreach $query (@subject) { - $sth->execute($query,$bibnum); + $sth->execute($query,$bibnum) if ($query && $bibnum); } # foreach $sth->finish; } # if @@ -2045,122 +2045,122 @@ sub char_decode { $_ = $string ; # $encoding = C4::Context->preference("marcflavour") unless $encoding; if ($encoding eq "UNIMARC") { - s/\xe1/€/gm ; - s/\xe2/€/gm ; - s/\xe9/€/gm ; - s/\xec/€/gm ; - s/\xf1/€/gm ; - s/\xf3/€/gm ; - s/\xf9/€/gm ; - s/\xfb/€/gm ; - s/\xc1\x61/€/gm ; - s/\xc1\x65/€/gm ; - s/\xc1\x69/€/gm ; - s/\xc1\x6f/€/gm ; - s/\xc1\x75/€/gm ; - s/\xc1\x41/€/gm ; - s/\xc1\x45/€/gm ; - s/\xc1\x49/€/gm ; - s/\xc1\x4f/€/gm ; - s/\xc1\x55/€/gm ; - s/\xc2\x41/€/gm ; - s/\xc2\x45/€/gm ; - s/\xc2\x49/€/gm ; - s/\xc2\x4f/€/gm ; - s/\xc2\x55/€/gm ; - s/\xc2\x59/€/gm ; - s/\xc2\x61/€/gm ; - s/\xc2\x65/€/gm ; - s/\xc2\x69/€/gm ; - s/\xc2\x6f/€/gm ; - s/\xc2\x75/€/gm ; - s/\xc2\x79/€/gm ; - s/\xc3\x41/€/gm ; - s/\xc3\x45/€/gm ; - s/\xc3\x49/€/gm ; - s/\xc3\x4f/€/gm ; - s/\xc3\x55/€/gm ; - s/\xc3\x61/€/gm ; - s/\xc3\x65/€/gm ; - s/\xc3\x69/€/gm ; - s/\xc3\x6f/€/gm ; - s/\xc3\x75/€/gm ; - s/\xc4\x41/€/gm ; - s/\xc4\x4e/€/gm ; - s/\xc4\x4f/€/gm ; - s/\xc4\x61/€/gm ; - s/\xc4\x6e/€/gm ; - s/\xc4\x6f/€/gm ; - s/\xc8\x45/€/gm ; - s/\xc8\x49/€/gm ; - s/\xc8\x65/€/gm ; - s/\xc8\x69/€/gm ; - s/\xc8\x76/€/gm ; - s/\xc9\x41/€/gm ; - s/\xc9\x4f/€/gm ; - s/\xc9\x55/€/gm ; - s/\xc9\x61/€/gm ; - s/\xc9\x6f/€/gm ; - s/\xc9\x75/€/gm ; - s/\xca\x41/€/gm ; - s/\xca\x61/€/gm ; - s/\xd0\x43/€/gm ; - s/\xd0\x63/€/gm ; + s/\xe1/Æ/gm ; + s/\xe2/Ð/gm ; + s/\xe9/Ø/gm ; + s/\xec/þ/gm ; + s/\xf1/æ/gm ; + s/\xf3/ð/gm ; + s/\xf9/ø/gm ; + s/\xfb/ß/gm ; + s/\xc1\x61/à/gm ; + s/\xc1\x65/è/gm ; + s/\xc1\x69/ì/gm ; + s/\xc1\x6f/ò/gm ; + s/\xc1\x75/ù/gm ; + s/\xc1\x41/À/gm ; + s/\xc1\x45/È/gm ; + s/\xc1\x49/Ì/gm ; + s/\xc1\x4f/Ò/gm ; + s/\xc1\x55/Ù/gm ; + s/\xc2\x41/Á/gm ; + s/\xc2\x45/É/gm ; + s/\xc2\x49/Í/gm ; + s/\xc2\x4f/Ó/gm ; + s/\xc2\x55/Ú/gm ; + s/\xc2\x59/Ý/gm ; + s/\xc2\x61/á/gm ; + s/\xc2\x65/é/gm ; + s/\xc2\x69/í/gm ; + s/\xc2\x6f/ó/gm ; + s/\xc2\x75/ú/gm ; + s/\xc2\x79/ý/gm ; + s/\xc3\x41/Â/gm ; + s/\xc3\x45/Ê/gm ; + s/\xc3\x49/Î/gm ; + s/\xc3\x4f/Ô/gm ; + s/\xc3\x55/Û/gm ; + s/\xc3\x61/â/gm ; + s/\xc3\x65/ê/gm ; + s/\xc3\x69/î/gm ; + s/\xc3\x6f/ô/gm ; + s/\xc3\x75/û/gm ; + s/\xc4\x41/Ã/gm ; + s/\xc4\x4e/Ñ/gm ; + s/\xc4\x4f/Õ/gm ; + s/\xc4\x61/ã/gm ; + s/\xc4\x6e/ñ/gm ; + s/\xc4\x6f/õ/gm ; + s/\xc8\x45/Ë/gm ; + s/\xc8\x49/Ï/gm ; + s/\xc8\x65/ë/gm ; + s/\xc8\x69/ï/gm ; + s/\xc8\x76/ÿ/gm ; + s/\xc9\x41/Ä/gm ; + s/\xc9\x4f/Ö/gm ; + s/\xc9\x55/Ü/gm ; + s/\xc9\x61/ä/gm ; + s/\xc9\x6f/ö/gm ; + s/\xc9\x75/ü/gm ; + s/\xca\x41/Å/gm ; + s/\xca\x61/å/gm ; + s/\xd0\x43/Ç/gm ; + s/\xd0\x63/ç/gm ; # this handles non-sorting blocks (if implementation requires this) $string = nsb_clean($_) ; } elsif ($encoding eq "USMARC" || $encoding eq "MARC21") { if(/[\xc1-\xff]/) { - s/\xe1\x61/€/gm ; - s/\xe1\x65/€/gm ; - s/\xe1\x69/€/gm ; - s/\xe1\x6f/€/gm ; - s/\xe1\x75/€/gm ; - s/\xe1\x41/€/gm ; - s/\xe1\x45/€/gm ; - s/\xe1\x49/€/gm ; - s/\xe1\x4f/€/gm ; - s/\xe1\x55/€/gm ; - s/\xe2\x41/€/gm ; - s/\xe2\x45/€/gm ; - s/\xe2\x49/€/gm ; - s/\xe2\x4f/€/gm ; - s/\xe2\x55/€/gm ; - s/\xe2\x59/€/gm ; - s/\xe2\x61/€/gm ; - s/\xe2\x65/€/gm ; - s/\xe2\x69/€/gm ; - s/\xe2\x6f/€/gm ; - s/\xe2\x75/€/gm ; - s/\xe2\x79/€/gm ; - s/\xe3\x41/€/gm ; - s/\xe3\x45/€/gm ; - s/\xe3\x49/€/gm ; - s/\xe3\x4f/€/gm ; - s/\xe3\x55/€/gm ; - s/\xe3\x61/€/gm ; - s/\xe3\x65/€/gm ; - s/\xe3\x69/€/gm ; - s/\xe3\x6f/€/gm ; - s/\xe3\x75/€/gm ; - s/\xe4\x41/€/gm ; - s/\xe4\x4e/€/gm ; - s/\xe4\x4f/€/gm ; - s/\xe4\x61/€/gm ; - s/\xe4\x6e/€/gm ; - s/\xe4\x6f/€/gm ; - s/\xe8\x45/€/gm ; - s/\xe8\x49/€/gm ; - s/\xe8\x65/€/gm ; - s/\xe8\x69/€/gm ; - s/\xe8\x76/€/gm ; - s/\xe9\x41/€/gm ; - s/\xe9\x4f/€/gm ; - s/\xe9\x55/€/gm ; - s/\xe9\x61/€/gm ; - s/\xe9\x6f/€/gm ; - s/\xe9\x75/€/gm ; - s/\xea\x41/€/gm ; - s/\xea\x61/€/gm ; + s/\xe1\x61/à/gm ; + s/\xe1\x65/è/gm ; + s/\xe1\x69/ì/gm ; + s/\xe1\x6f/ò/gm ; + s/\xe1\x75/ù/gm ; + s/\xe1\x41/À/gm ; + s/\xe1\x45/È/gm ; + s/\xe1\x49/Ì/gm ; + s/\xe1\x4f/Ò/gm ; + s/\xe1\x55/Ù/gm ; + s/\xe2\x41/Á/gm ; + s/\xe2\x45/É/gm ; + s/\xe2\x49/Í/gm ; + s/\xe2\x4f/Ó/gm ; + s/\xe2\x55/Ú/gm ; + s/\xe2\x59/Ý/gm ; + s/\xe2\x61/á/gm ; + s/\xe2\x65/é/gm ; + s/\xe2\x69/í/gm ; + s/\xe2\x6f/ó/gm ; + s/\xe2\x75/ú/gm ; + s/\xe2\x79/ý/gm ; + s/\xe3\x41/Â/gm ; + s/\xe3\x45/Ê/gm ; + s/\xe3\x49/Î/gm ; + s/\xe3\x4f/Ô/gm ; + s/\xe3\x55/Û/gm ; + s/\xe3\x61/â/gm ; + s/\xe3\x65/ê/gm ; + s/\xe3\x69/î/gm ; + s/\xe3\x6f/ô/gm ; + s/\xe3\x75/û/gm ; + s/\xe4\x41/Ã/gm ; + s/\xe4\x4e/Ñ/gm ; + s/\xe4\x4f/Õ/gm ; + s/\xe4\x61/ã/gm ; + s/\xe4\x6e/ñ/gm ; + s/\xe4\x6f/õ/gm ; + s/\xe8\x45/Ë/gm ; + s/\xe8\x49/Ï/gm ; + s/\xe8\x65/ë/gm ; + s/\xe8\x69/ï/gm ; + s/\xe8\x76/ÿ/gm ; + s/\xe9\x41/Ä/gm ; + s/\xe9\x4f/Ö/gm ; + s/\xe9\x55/Ü/gm ; + s/\xe9\x61/ä/gm ; + s/\xe9\x6f/ö/gm ; + s/\xe9\x75/ü/gm ; + s/\xea\x41/Å/gm ; + s/\xea\x61/å/gm ; # this handles non-sorting blocks (if implementation requires this) $string = nsb_clean($_) ; } @@ -2194,6 +2194,9 @@ Paul POULAIN paul.poulain@free.fr # $Id$ # $Log$ +# Revision 1.86 2004/05/03 09:19:22 tipaul +# some fixes for mysql prepare & execute +# # Revision 1.85 2004/04/02 14:55:48 tipaul # renaming items.bulk field to items.itemcallnumber. # Will be used to store call number for libraries that don't use dewey classification. -- 2.39.5