Home » SQL & PL/SQL » SQL & PL/SQL » Error handling in bulk insert/merge
Error handling in bulk insert/merge [message #251323] Thu, 12 July 2007 22:40 Go to next message
Messages: 5
Registered: June 2007
Junior Member

I am using MERGE statement(Oracle 10g) in my stored procedure. During this process, if there is error in one record, it is moving to exception block and not processing further records. The error is due to foreign key constraint.

Is there a possibility of skipping that records, possibly logging error in a file and continuing with other records?

I tried to use LOG ERRORS clause, but that doesn't work for foreign key constraints.

Is there a way to achieve this without using LOG ERRORS clause?

Re: Error handling in bulk insert/merge [message #251340 is a reply to message #251323] Fri, 13 July 2007 01:23 Go to previous messageGo to next message
Michel Cadot
Messages: 65155
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Copy and paste your SQL*Plus session with a description of your tables and constraints.

Re: Error handling in bulk insert/merge [message #251349 is a reply to message #251340] Fri, 13 July 2007 02:02 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
It says here that you can use LOG ERRORS to trap foreign key violations.

Ross Leishman
Previous Topic: Database level DML triggers
Next Topic: can a CASE is included in Where Clause.....
Goto Forum:

Current Time: Wed Aug 23 20:21:46 CDT 2017

Total time taken to generate the page: 0.12565 seconds