koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-devel] Duplicate items in MARC tables


From: Baiju M
Subject: [Koha-devel] Duplicate items in MARC tables
Date: Sun Apr 11 22:26:19 2004

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?SRC=lycos10


From address@hidden Tue Apr 13 01:47:17 2004
Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] 
helo=sc8-sf-mx2.sourceforge.net)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]