Skip to content

Instantly share code, notes, and snippets.

@wanion
Last active August 29, 2015 14:16
Show Gist options
  • Save wanion/908873fc342c27ccf088 to your computer and use it in GitHub Desktop.
Save wanion/908873fc342c27ccf088 to your computer and use it in GitHub Desktop.
Bibs and holdings by location code in Voyager 8.1.1
SELECT bib_text.bib_id, bib_master.suppress_in_opac AS suppressed, utl_i18n.raw_to_nchar(rawtohex(
title), 'utf8') AS title, utl_i18n.raw_to_nchar(rawtohex(author), 'utf8') AS author
FROM bib_text
JOIN bib_master ON bib_master.bib_id = bib_text.bib_id
JOIN bib_location ON bib_text.bib_id = bib_location.bib_id
JOIN location ON bib_location.location_id = location.location_id
WHERE upper(location_code) = upper('&location_code')
ORDER BY 3, 1
SELECT bib_text.bib_id, mfhd_master.mfhd_id, mfhd_master.suppress_in_opac AS suppressed,
utl_i18n.raw_to_nchar(rawtohex(title), 'utf8') AS title, utl_i18n.raw_to_nchar(rawtohex(author),
'utf8') AS author
FROM bib_text
JOIN bib_mfhd ON bib_mfhd.bib_id = bib_text.bib_id
JOIN mfhd_master ON mfhd_master.mfhd_id = bib_mfhd.mfhd_id
JOIN location ON mfhd_master.location_id = location.location_id
WHERE upper(location_code) = upper('&location_code')
ORDER BY 4, 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment