https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30043

--- Comment #1 from Magnus Enger <[email protected]> ---
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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to