Skip to main content
ExLibris

Knowledge Assistant

BETA
 
  • Subscribe by RSS
  • Back
    Aleph

     

    Ex Libris Knowledge Center
    1. Search site
      Go back to previous article
      1. Sign in
        • Sign in
        • Forgot password
    1. Home
    2. Aleph
    3. Knowledge Articles
    4. Unique constraint (XXX50.Z305_ID) violated

    Unique constraint (XXX50.Z305_ID) violated

    1. Last updated
    2. Save as PDF
    3. Share
      1. Share
      2. Tweet
      3. Share
    No headers
    • Article Type: General
    • Product: Aleph
    • Product Version: 20

    Problem Symptoms:
    Running SQL to change sublibrary of certain XXX50 Z305 (PATRON?€™S LOCAL INFORMATION) records from 'YYYYY' to ' ZZZZZ':

    UPDATE Z305
    SET Z305_REC_KEY = substr(Z305_REC_KEY,1,12) || 'ZZZZZ'
    where substr(Z305_REC_KEY,13,5) = 'YYYYY'

    results in the following message:

    Error:
    *
    ERROR at line 1:
    ORA-00001: unique constraint (XXX50.Z305_ID) violated

    Cause:
    SQL didn't include check to see if a "ZZZZZ" record already existed for the patron.

    Resolution:
    Add check to see if a "ZZZZZ" record already exists for patron:

    UPDATE Z305
    SET Z305_REC_KEY = substr(Z305_REC_KEY,1,12) || 'ZZZZZ'
    where substr(Z305_REC_KEY,13,5) = 'YYYYY'
    and substr(Z305_REC_KEY,1,12) not in
    (select substr (Z305_REC_KEY,1,12) from z305 where substr (Z305_REC_KEY,13,5) = 'ZZZZZ');

    Category: System Management (500)

    Subject: Oracle (500)


    • Article last edited: 10/8/2013
    View article in the Exlibris Knowledge Center
    1. Back to top
      • unique constraint (ABC01.Z69_ID) violated
      • unique constraint (xxx50.z34_ID )"
    • Was this article helpful?

    Recommended articles

    1. Article type
      Topic
      Language
      English
      Product
      Aleph
    2. Tags
      1. 20
      2. contype:kba
      3. Oracle (500)
      4. Prod:Aleph
      5. System Management (500)
      6. Type:General
    1. © Copyright 2025 Ex Libris Knowledge Center
    2. Powered by CXone Expert ®
    • Term of Use
    • Privacy Policy
    • Contact Us
    2025 Ex Libris. All rights reserved