RE: data dictionary view with all oracle errors in it?

  • From: Srinivasan Vasan <Vasan.Srinivasan@xxxxxxxxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 29 Jul 2004 15:29:03 +0100

I have this in my toolkit, to query only the error I am interested in:
 

Function Oerr (In_Number     In  Number)

   Return Varchar2

Is

Begin

   If In_Number < 0

   Then

      Return Sqlerrm (In_Number);

   Else

      Return Sqlerrm (-1*In_Number);

   End If;

End Oerr;

 

Cheers, 

 

Vasan.

 

-----Original Message-----
From: Jared.Still@xxxxxxxxxxx [mailto:Jared.Still@xxxxxxxxxxx] 
Sent: 28 July 2004 18:08
To: oracle-l@xxxxxxxxxxxxx
Subject: Re: data dictionary view with all oracle errors in it?

 

oracle-l-bounce@xxxxxxxxxxxxx wrote on 07/27/2004 08:43:42 AM:

> Someone once posted here a cool script to retrieve the Oracle errors 

(also

> event descriptions) in PL/SQL:

> 

> SET SERVEROUTPUT ON

>      DECLARE

>        err_msg VARCHAR2(1000);

>      BEGIN

>        dbms_output.enable (1000000);

>        FOR err_num IN 10000..11005

> --       FOR err_num IN 38001..39000

>        LOOP

>          err_msg := SQLERRM (-err_num);

>          IF err_msg NOT LIKE '%Message '||err_num||' not found%' THEN

>            dbms_output.put_line (err_msg);

>          END IF;

>        END LOOP;

>      END;

> /

> 

> Tanel.

> 

 

 

I find this version to be a little more useful.  The dbms_output buffer is

not large enough for all messages, and some must be broken in to segments

to display via put_line (255 char limit)

 

Jared

 

drop table oerrors;

create table oerrors ( errnum number, msg varchar2(4000));

 

DECLARE

        err_msg VARCHAR2(1000);

        oline varchar2(1000);

BEGIN

        FOR err_num IN 1..65535

        LOOP

                err_msg := SQLERRM (-err_num);

                IF err_msg NOT LIKE '%Message '||err_num||' not found%' 

THEN

                        insert into oerrors values(err_num, err_msg);

                END IF;

        END LOOP;

        commit;

END;

/

 

 

col msg format a100

set linesize 120

set pagesize 0

 

spool oerrors.txt

 

select errnum, msg

from oerrors

order by errnum

/

 

spool off

 

 

----------------------------------------------------------------

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

----------------------------------------------------------------

To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx

put 'unsubscribe' in the subject line.

--

Archives are at //www.freelists.org/archives/oracle-l/

FAQ is at //www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------


___________________________________________________________________________ 


This email and any attached to it are confidential and intended only for the
individual or entity to which it is addressed.  If you are not the intended
recipient, please let us know by telephoning or emailing the sender.  You
should also delete the email and any attachment from your systems and should
not copy the email or any attachment or disclose their content to any other
person or entity.  The views expressed here are not necessarily those of
Churchill Insurance Group plc or its affiliates or subsidiaries. Thank you. 

Churchill Insurance Group plc.  Company Registration Number - 2280426.
England. 

Registered Office: Churchill Court, Westmoreland Road, Bromley, Kent BR1
1DP. 




----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: