FAQ
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).

Search Discussions

  • Peter Gram at Jun 13, 2001 at 9:56 pm
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedJun 13, '01 at 9:19p
activeJun 13, '01 at 9:56p
posts2
users2
websiteoracle.com

2 users in discussion

Peter Gram: 1 post Krishna Kakatur: 1 post

People

Translate

site design / logo © 2022 Grokbase