Home » SQL & PL/SQL » SQL & PL/SQL » Exception Handling
Exception Handling [message #379881] Thu, 08 January 2009 04:23 Go to next message
brandointheweb
Messages: 25
Registered: August 2005
Location: Germany
Junior Member
Hello to all,
a question to exception handling!
Until now I helped myself with following code:
EXCEPTION
   WHEN OTHERS THEN
        vSQL_CODE := SQLCODE;
        vSQL_FEHLER := SQLERRM;
        INSERT INTO TBMYERROR_TABLE(USERNAME,PROJECTNAME,OBJECTNAME,SQL_CODE,SQL_ERROR)
         --      VALUES('SOME NAME','PROJECT A ','OBJECT_NAME A',vSQL_CODE,vSQL_FEHLER);
        --NULL;


Is ther a way to get the line-number of the error to store it also??

Best regards!
MArlon
Re: Exception Handling [message #379885 is a reply to message #379881] Thu, 08 January 2009 04:27 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
Look for package


DBMS_UTILITY.FORMAT_ERROR_STACK


http://www.oracle.com/technology/oramag/oracle/05-mar/o25plsql.html

Thanks
Trivendra

Re: Exception Handling [message #379888 is a reply to message #379881] Thu, 08 January 2009 04:28 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at DBMS_UTILITY.FORMAT_ERROR_BACKTRACE and DBMS_UTILITY.FORMAT_ERROR_STACK functions.

Regards
Michel
Re: Exception Handling [message #379891 is a reply to message #379881] Thu, 08 January 2009 04:30 Go to previous message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
More crucially, that insert needs to be an autonomous transaction, and it needs to be followed by a RAISE command.
Previous Topic: Flashback update statement
Next Topic: Building Strings (merged)
Goto Forum:
  


Current Time: Wed Dec 07 20:07:18 CST 2016

Total time taken to generate the page: 0.05110 seconds