[Koha] Editing content of MARC field 300 - is this the way to go?

Michael Kuhn mik at adminkuhn.ch
Wed Jun 7 01:19:39 NZST 2017


Hi

We are working with Debian 8 and a package installation of Koha 
16.11.04. The database is filled with bibliographic records which are 
connected to tables "issues" and "biblioitems", also they are linked to 
authority data.

We want to edit the content of MARC field 300 which may look like:

   <datafield tag="300" ind1=" " ind2=" ">
     <subfield code="a">1 map : col. ; 34 x 47 cm</subfield>
     <subfield code="c">9 pictures</subfield>
   </datafield>

to (for example):

   <datafield tag="300" ind1=" " ind2=" ">
     <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield>
   </datafield>

It seems not possible to do this using Koha menu "Tools > MARC 
modification templates" since the new content of MARC field 300 is 
different for every records and I would have to create many thousands of 
template actions.

Thus I have tried the following:

1. I have unloaded the content of field "marcxml" for every record in 
table "biblioitems" and cut off everything except the tags and content 
for MARC field 300. I have then created an SQL statement replacing this 
content with the new content for the affected record:

UPDATE biblioitems SET marcxml = REPLACE( marcxml, '<datafield tag="300" 
ind1=" " ind2=" ">\n    <subfield code="a">1 map :</subfield>\n 
<subfield code="b">col. ;</subfield>\n    <subfield code="c">34 x 47 cm. 
fold. to 25 x 10 cm.</subfield>', '<datafield tag="300" ind1=" " ind2=" 
">\n    <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield>')
WHERE ExtractValue(biblioitems.marcxml,'//controlfield[@tag="001"]') = 
5451649;

2. Like this the content for MARC field 300 in field "marcxml" was 
correctly changed and I can immediately see the desired result in the 
Koha OPAC and staff client. No reindexing was needed.

3. But the content of tag <leader> in field "marcxml" has NOT changed 
(so it still shows the old number of characters of the record). I don't 
know if this is a problem or how it could be easily solved.

My question: Is this the way to go or does anyone have another idea how 
to accomplish this task? Maybe this is even described in some documentation?

Best wishes: Michael
-- 
Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
T 0041 (0)61 261 55 61 · E mik at adminkuhn.ch · W www.adminkuhn.ch


More information about the Koha mailing list