4 #use warnings; FIXME - Bug 2505
9 my $dbh=C4
::Context
->dbh;
11 if (C4
::Context
->preference("marcflavour") ne "UNIMARC") {
12 print "this script is for UNIMARC only\n";
15 my $rqbiblios=$dbh->prepare("SELECT biblionumber from biblioitems");
16 my $rqitemnumber=$dbh->prepare("SELECT itemnumber, biblionumber from items where itemnumber = ? and biblionumber = ?");
20 while (my ($biblionumber)= $rqbiblios->fetchrow_array){
21 my $record=GetMarcBiblio
($biblionumber);
22 foreach my $itemfield ($record->field('995')){
23 my $marcitem=MARC
::Record
->new();
24 $marcitem->encoding('UTF-8');
25 $marcitem->append_fields($itemfield);
29 my @itemnumbers = $itemfield->subfield('9');
30 foreach my $itemnumber ( @itemnumbers ){
31 $rqitemnumber->execute($itemnumber, $biblionumber);
32 if( my $row = $rqitemnumber->fetchrow_hashref ){
33 $itemnum = $row->{itemnumber
};
39 ModItemFromMarc
($marcitem,$biblionumber,$itemnum)
44 print "\r$biblionumber";
46 warn "Problem with : $biblionumber : $@";
47 warn $record->as_formatted;