Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Capturing ORA errors and inserting into a table II

Re: Capturing ORA errors and inserting into a table II

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Wed, 08 May 2002 03:43:24 -0800
Message-ID: <F001.0045B365.20020508034324@fatcity.com>


Ooops ... Forgot to mention that autonomous transactions are a topic which may be of interest to you as well. The idea is : 1) write a procedure which takes as input parameter a string (you will pass the error message) and any information of interest to you. I call it log_proc(). In this procedure AND IN AN AUTONOMOUS TRANSACTION, you insert into a log table and commit.
2) In your exception handler you just put :

                   log_proc(SQLERRM, ...)
                   raise;

The error will be logged, the error will be propagated up the call chain, and the log entry will stay even if you rollback your transaction. Et voila.

--

Regards,

Stephane Faroult
Oriole Software
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed May 08 2002 - 06:43:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US