[OPEN-ILS-GENERAL] SQL help with MARC LDR

Mike Rylander mrylander at gmail.com
Fri Mar 16 14:37:56 EDT 2012


On Fri, Mar 16, 2012 at 2:27 PM, Mary Llewellyn <mllewell at biblio.org> wrote:
> Hi all,
>
> Does anyone know how to write a SQL query to specify a particular Elvl value
> (character position 17) in the MARC LDR to retrieve a list of bibs with that
> value? To be clearer, I’d like to get a list of bibs that have Elvl “3”.
>
> I know how to retrieve records from the metabib,real_full_rec table based on
> a tag, but not how to specify a particular byte in the LDR.
>

On version 2.1 and beyond you can say:

SELECT id FROM metabib.record_attr WHERE attrs @> 'enc_level=>3'::HSTORE;

and, before that:

SELECT record FROM metabib.rec_descriptor WHERE enc_level = '3';

HTH,

-- 
Mike Rylander
 | Director of Research and Development
 | Equinox Software, Inc. / Your Library's Guide to Open Source
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  miker at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-general mailing list