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: 64953
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: Old ANSI join syntax works for correlated subquery, new ANSI join syntax does not --- why?
Next Topic: Bulk collect ..for all..with execute immediate in 8i ???
Goto Forum:

Current Time: Sat Jun 24 22:51:21 CDT 2017

Total time taken to generate the page: 0.05739 seconds