Skip to main content
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    SQL report of bib records linked to multiple collection codes or call numbers


    • Product: Aleph
    • Product Version: 20, 21, 22, 23
    • Relevant for Installation Type: Dedicated-Direct, Direct, Local, Total Care



    We need a report of bib records which have items linked to them with either multiple collection codes or multiple call numbers. 


    The following is an SQL script (run in the ADM library)  which gives you that:

    set pause off
    set term off
    set show off
    set feed off
    set verify off
    set heading off
    set pagesize 58
    set echo off
    set linesize 70

    spool bibs-with-multiple.lst

    select unique z13_rec_key, z13_title, a.z30_barcode, b.z30_barcode, a.z30_call_no, b.z30_call_no from xxx01.z13, z30 a, z30 b, z103 where  Z13_REC_KEY = substr (Z103_REC_KEY_1,6,9) and substr (Z103_REC_KEY_1,1,5) = 'XXX01' and substr (Z103_REC_KEY,6,9) = substr (a.Z30_REC_KEY,1,9) and substr (Z103_REC_KEY,6,9) = substr (b.Z30_REC_KEY,1,9) and (a.z30_collection ^= b.z30_collection or a.z30_call_no ^= b.z30_call_no) ;

    spool off

    <end script>

    Note:  you will need to change the "xxx01" and the "XXX01" to your local bib library.



    • Article last edited: 8-Mar-2018