[Koha-bugs] [Bug 30043] Malformed records shown as not existing
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Feb 8 11:47:53 CET 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30043
--- Comment #1 from Magnus Enger <magnus at libriotech.no> ---
SQL to find and fix records with an empty 942 field:
SELECT
biblionumber,
timestamp,
ExtractValue( metadata, 'count( //datafield[@tag="942"] )' ) AS count_fields,
ExtractValue( metadata, 'count( //datafield[@tag="942"]/* )' ) AS
count_subfields
FROM
biblio_metadata
HAVING
count_fields > 0
AND count_subfields = 0;
UPDATE
biblio_metadata
SET
metadata = UpdateXML( metadata, '//datafield[@tag="942"]', '' )
WHERE
biblionumber IN ( x,y,z );
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list