[OPEN-ILS-DEV] how to batch edit a marc tag in EG using sql?

Jason Etheridge jason at esilibrary.com
Thu Oct 29 11:58:49 EDT 2009


> Does anyone have any sample code for this kind of thing?

I think the closest thing on the wiki is some SQL for pruning tags:

http://evergreen-ils.org/dokuwiki/doku.php?id=scratchpad:random_magic_spells#how_to_prune_a_tag_under_the_hood

UPDATE biblio.record_entry SET marc = regexp_replace(marc,E'<datafield
tag="059".+?</datafield>','','g');
DELETE FROM metabib.full_rec WHERE tag = '059';

If the tags are not being indexed, then I suspect that
biblio.record_entry and metabib.full_rec are all that you need to
modify.

You could try modifying just one of the records and see how that goes.

-- 
Jason Etheridge
 | VP, Tactical Development
 | Equinox Software, Inc. / The Evergreen Experts
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  jason at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-dev mailing list