Home » SQL & PL/SQL » SQL & PL/SQL » DML Error logging
DML Error logging [message #259495] Wed, 15 August 2007 14:03 Go to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
Yesterday I attended a conference sponsored by Oracle where Tom Kyte gave two presentations.
I learned about a new feature in V10.2 that I previously did not know about.
Below is now legal SQL.
INSERT /*+ APPEND PARALLEL */
INTO sales SELECT product_id, customer_id, TRUNC(sales_date), 3,
   promotion_id, quantity, amount
FROM sales_activity_direct
LOG ERRORS INTO sales_activity_errors('load_20040802') REJECT LIMIT UNLIMITED

The last line will insert into "sales_activity_errors" the records which failed
& it will report why that particular record failed to INSERT.
DBMS_ERRLOG is a new procedure that creates the error logging table used by the LOG ERRORS INTO clause.
This approach should only be used when less than 1% of the records fail.
Re: DML Error logging [message #259498 is a reply to message #259495] Wed, 15 August 2007 14:13 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Thanks for sharing.
Re: DML Error logging [message #259500 is a reply to message #259495] Wed, 15 August 2007 14:18 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is true for all DML statements.

http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB

Regards
Michel
Previous Topic: Using avg in a sub query
Next Topic: Partition index analyze
Goto Forum:
  


Current Time: Sun Dec 04 00:08:15 CST 2016

Total time taken to generate the page: 0.11537 seconds