Need some SQL help
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
Hi, On Fri, Apr 19, 2013 at 10:54 AM, Doug Dearden <dearden@sarsf.org> wrote:
So what would the SQL/Xpath syntax be to get the info out of ind2 ?
Here's the XPath: //datafield[@tag="245"]/@ind2 Regards, Galen -- Galen Charlton Manager of Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
Thanks Galen, that did it. Seems so obvious now. :) Doug -----Original Message----- From: Galen Charlton [mailto:gmc@esilibrary.com] Sent: Friday, April 19, 2013 12:10 PM To: Doug Dearden Cc: koha@lists.katipo.co.nz Subject: Re: [Koha] Need some SQL help Hi, On Fri, Apr 19, 2013 at 10:54 AM, Doug Dearden <dearden@sarsf.org> wrote:
So what would the SQL/Xpath syntax be to get the info out of ind2 ?
Here's the XPath: //datafield[@tag="245"]/@ind2 Regards, Galen -- Galen Charlton Manager of Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
participants (2)
-
Doug Dearden -
Galen Charlton