Duplicate items in MARC tables
Hi, When I imported some MARC records to Koha using bulkmarcimport.pl (I am using Koha 2.0.0) I get duplicate items in MARC tables (items just doubles in 'marc_subfield_table', but not in 'items' table) A portion from database dump : INSERT INTO marc_subfield_table VALUES (70064,3524,'952',8,'','p',3,'34511',NULL), (70065,3524,'952',8,'','u',5,'34511',NULL), (70066,3524,'090',9,'','c',1,'3524',NULL), (70067,3524,'090',9,'','d',2,'3524',NULL), (70068,3524,'952',10,'','b',1,'MAIN',NULL), (70069,3524,'952',10,'','d',2,'MAIN',NULL), (70070,3524,'952',10,'','p',3,'34511',NULL), (70071,3524,'952',10,'','u',5,'34511',NULL), (70072,3524,'952',10,'','u',7,'4339',NULL), (70073,3525,'100',1,'1','a',1,'David W Lindsay',NULL), (70074,3525,'245',2,'12','a',1,'English poetry 1700-1780',NULL), (70075,3525,'300',4,'','f',2,'BOOK',NULL), (70076,3525,'590',5,'','a',1,'ED',NULL), (70077,3525,'700',6,'1','a',1,'',NULL), (70078,3525,'852',7,'','k',1,'999.9997',NULL), (70079,3525,'852',7,'','h',2,'L4',NULL), (70080,3525,'952',8,'','b',1,'MAIN',NULL), (70081,3525,'952',8,'','d',2,'MAIN',NULL), (70082,3525,'952',8,'','p',3,'34514',NULL), (70083,3525,'952',8,'','u',5,'34514',NULL), (70084,3525,'090',9,'','c',1,'3525',NULL), (70085,3525,'090',9,'','d',2,'3525',NULL), (70086,3525,'952',10,'','b',1,'MAIN',NULL), (70087,3525,'952',10,'','d',2,'MAIN',NULL), (70088,3525,'952',10,'','p',3,'34514',NULL), (70089,3525,'952',10,'','u',5,'34514',NULL), (70090,3525,'952',10,'','u',7,'4340',NULL), See 952 'p' & 'u' repeats and 'u' not only repeats it gets one more value. Now, I just started looking to source codes. When I looked into bulkmarcimport.pl I found the last for loop creates this problem : for (my $i=0;$i<=$#items;$i++) { NEWnewitem($dbh,$items[$i],$bibid); } When I just commented this for loop, the problem in 'marc_subfield_table' got fixed. But then, there was no items in 'items' table. If this is really a bug, will try to fix it myself. Could anyone give any pointer? Now I am trying to explore it more, here is some other clues I got. NEWnewbiblio function creates bibio and items in MARC tables (and only bibio in NON-MARC tables) my ($bibid,$oldbibnum,$oldbibitemnum) = NEWnewbiblio($dbh,$newRecord); NEWnewitem function creates items in both MARC and NON-MARC tables, in addition to that it also creates one more 952 'u' for each item(?). NEWnewbiblio function is calling from acqui.simple/addbiblio.pl (Here it will not create any items, just because there is no items) ($bibid,$oldbibnum,$oldbibitemnum) = NEWnewbiblio($dbh,$record); So, I think NEWnewbiblio cannot use in bulkmarcimport.pl as in the case of addbiblio.pl Atleast it should have a parameter not to add 952 fields(?) NEWnewitem function is calling from acqui.simple/additem.pl my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWnewitem($dbh,$record,$bibid) and this function should use to add items everywhere(including bulkmarcimport). See, I am just started looking to Koha source code, so my observation maynot be correct. With thanks and regards, Baiju M ____________________________________________________________ Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp...
Baiju M a écrit :
Hi, When I imported some MARC records to Koha using bulkmarcimport.pl (I am using Koha 2.0.0) I get duplicate items in MARC tables (items just doubles in 'marc_subfield_table', but not in 'items' table)
See 952 'p' & 'u' repeats and 'u' not only repeats it gets one more value.
Now, I just started looking to source codes. When I looked into bulkmarcimport.pl I found the last for loop creates this problem : for (my $i=0;$i<=$#items;$i++) { NEWnewitem($dbh,$items[$i],$bibid); } When I just commented this for loop, the problem in 'marc_subfield_table' got fixed. But then, there was no items in 'items' table. If this is really a bug, will try to fix it myself. Could anyone give any pointer?
2 questions : * could you show us your iso2709 file ? Use dumpmarc.pl script in misc directory (with bulkmarcimport). It can be a "problem" in your iso2709 file. * how did you set you MARC21 parameters tables ?
Now I am trying to explore it more, here is some other clues I got.
So, I think NEWnewbiblio cannot use in bulkmarcimport.pl as in the case of addbiblio.pl Atleast it should have a parameter not to add 952 fields(?)
Here may be the solution : the bulkmarcimport script splits your marc data in 2 parts : biblio & items. The items are found using your MARC setup. so, if 952 is not "mapped" to items, it won't work well. HTH, let us know -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
participants (2)
-
Baiju M -
paul POULAIN