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

    Unique constraint (xxxnn.Znn_ID) violated" *COMPREHENSIVE RECORD*

    • Article Type: General
    • Product: Aleph
    • Product Version: 18.01

    You see this message in a pc_server, www_server, or oclc_server log:

    ORA-00001: unique constraint (xxxnn.Znn_ID) violated

    <where "xxxnn" is a library and ""Znn" is an Oracle table>.

    This indicates that an update or insert statement attempted to insert a duplicate key into the Znn table of the xxxnn library.

    Columns defined as unique acquire their value in one of three ways:

    1. Counters in the z52 tables (viewed using UTIL-G-2). Examples are: last-doc-number, last-acc-number, last-word-number, last-bor-id, last-loan-number, last-request-number, session-id.

    2. Oracle SEQUENCE's.
    One example is the LAST_RESULT_SET sequence in the VIR01 library.
    Another is the last_record_sequence in the $pw_library, which is used by all of the following tables: z309, z31, z45, z601, and z71. (See KB 5149 for more on this.)

    3. The program examines all records, looking for the highest value, and adds 1 to it. This is the Z30-ITEM-SEQUENCE number is assigned.

    Files which have numbers assigned sequentially can wrap around to the beginning and try to assign the number 00000001 again. (In general, the counters are big enough that this is not a problem.)

    There are a number of KB records for specific files; search for "unique constraint znn" (All words) <where "znn" is the table which has the error>.

    Additional Information


    • Article last edited: 10/8/2013