On Wed, Oct 31, 2012 at 8:12 PM, Paul <paul.a@aandc.org> wrote:
At 02:27 PM 10/31/2012 -0600, Mike Hafen wrote:
Would an SQL Update statement be more effective here?  Like:
UPDATE biblio SET author = ExtractValue(marcxml,'//datafield[@tag="100"]/subfield[@code>="a"]') WHERE author IS NULL

Many thanks for the suggestion, but I ran into problems -- I think it's to do with mixing a straightforward 'table/column' as in biblio.author with an 'ExtractValue' from a different table.

Here's your suggestion:

mysql> UPDATE biblio SET author = ExtractValue(marcxml,'//datafield[@tag="100"]/subfield[@code>="a"]') WHERE author IS NULL;
ERROR 1054 (42S22): Unknown column 'marcxml' in 'field list'

IIRC you cannot use ExtractValue with UPDATE, INSERT, or SELECT INTO statements. Somewhere back in the list archives we discussed this, but neither Google nor I seem to be able to locate it at the moment.

Kind Regards,
Chris