Thread: Bulk insert & error logging
08-04-04, 13:52 #1Registered User
- Join Date
- May 2003
Unanswered: Bulk insert & error logging
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
08-04-04, 14:12 #2Registered User
- 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.
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 ...