Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003

    Unanswered: Bulk insert & error logging

    Hi All

    Currently I am having a scenario of some sort of bulk insert.
    i.e. Insert into schm2.tablename select * from schm1.tablename where ------;

    Now when i execute the same & suppose the records are already existing for the PK/unique records I get an oracle ora-00001 unique constraint violated error.

    But what i want is when i am doing such a huge insert where 1000's of inserts are involved I want to know which actual record failed the unique constraint.

    The type of insert I have above when i execute does not give me the actual row value which failed but only a generic unique constraint failure

    How can i trap the actual value which failed the unique constraint


  2. #2
    Join Date
    Jul 2003
    sqlload into the new table.
    this way you can create files for the bad rows.

    The rows that violate the PK get thrown into the sqlload.BAD file I believe.

    another option:
    write a join query to supply you with the output of all duplicates
    write a join insert which only loads proper/unique values
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts