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: Can we capture all errors through SQLERRM ?

Re: Can we capture all errors through SQLERRM ?

From: Peter Gram <Peter.gram_at_miracleas.dk>
Date: Wed, 13 Jun 2001 14:56:34 -0700
Message-ID: <F001.00328A14.20010613150539@fatcity.com>

Hi Krishna
Try
FORMAT_ERROR_STACK Function
This function formats the current error stack. This can be used in exception handlers to look at the full error stack. Syntax
DBMS_UTILITY.FORMAT_ERROR_STACK   RETURN VARCHAR2; Parameters
None.
Returns
This returns the error stack, up to 2000 bytes.
 
 

Krishna Kakatur wrote:
Hi,
How can I capture the second error message (ORA-06512: at line 4) in Exception handler? I want to capture all the messages and insert them into
Error Log table.



SQL> declare
  2  n number;
  3  begin
  4  n := 'Not a Number';
  5  end;
  6  /

declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 4
------------------------------------------------------------------
SQL> declare
  2  n number;
  3  begin
  4  n := 'Not a Number';
  5  exception
  6  when others then
  7  dbms_output.put_line (SQLCODE ||' >>> '|| SQLERRM);
  8  end;
  9  /

-6502 >>> ORA-06502: PL/SQL: numeric or value error PL/SQL procedure successfully completed.

TIA, Krishna

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Krishna Kakatur

  INET: master_dba_at_hotmail.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). -- Regards Peter Gram Miracle A/S http://MiracleAS.dk Tel: +45 2527 7107
 
smime.p7s

Received on Wed Jun 13 2001 - 16:56:34 CDT

Original text of this message

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