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