[Koha] Need some SQL help

Doug Dearden dearden at sarsf.org
Sat Apr 20 05:54:24 NZST 2013


Hello all,

I find myself once again confounded by an SQL problem.  I am trying to extract the value from field 245, ind2 .  I have used a variety of select statements without success, i.e.

SELECT EXTRACTVALUE(marcxml,'//datafield[@tag="245"][ind2]') as "SkipArticle"
or
SELECT EXTRACTVALUE(marcxml,'//datafield[@tag="245"]/subfield[@code="ind2"]') as "SkipArticle"

Those are two of the variations I have tried.  There are probably another 20 along the way.

When I look at the marcxml field I see that ind1 and ind2 are on the same line as the 245 identifier, and not in a subfield line.  For instance:

<datafield tag="245" ind1="1" ind2="0">
    <subfield code="a">Biology unmoored :</subfield>
    <subfield code="b">Melanesian reflections on life and biotechnology /</subfield>

A number of my attempts have not returned a syntax error, they just never return a value.

So what would the SQL/Xpath syntax be to get the info out of ind2 ?

Thanks in advance for your help,

Doug Dearden
Director, IT
School for Advanced Research
(505)954-7220
sarweb.org



More information about the Koha mailing list