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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Trapping Exception Messages within a PL/SQL program

Re: Trapping Exception Messages within a PL/SQL program

From: <steveee_ca_at_my-deja.com>
Date: Fri, 29 Dec 2000 12:17:43 GMT
Message-ID: <92hvd6$6nm$1@nnrp1.deja.com>

In article <B67155B4.252D%fclee_at_earthlink.net>,   "Frederick C. Lee" <fclee_at_earthlink.net> wrote:
> Greetings:
> I've trapped many exceptions, but rarely understand them. Passing
 the
> exception to the parent procedure would allow me to see some ambiguous
> ORA-number.
>
> I would like to trap or decipher the code & message of such
 exceptions
> and be able to either present the trapped message to the user such as
 via an
> alert, or from within a stored procedure written to an *.err file for
 later
> review {such as from a batch process}.
>
> Also, if anyone can suggest a handbook of <all> error/exception
 codes and
> their meanings...that would be great!
>
> Thanks.
>
> Ric.
>
> Hi Ric,

The purpose of exception handling is to prevent those lovely Oracle server messages from reaching the end user. Exceptions are designed for run - time error handling rather than compile time error handling (these are detected by the PL/SQL engine during compilation). When an error occurs, and exception is 'raised' and control is passed to the exception  section of your PL/SQL block..there you can dictate what action to take for particular exceptions; you also have a 'catchall' exception handler at your disposal (WHEN OTHERS THEN..) for exceptions you don't specifically name.
Oracle docs have a book of all Error Messages..probably available on technet too..

Hope this helps,

Steve

Sent via Deja.com
http://www.deja.com/ Received on Fri Dec 29 2000 - 06:17:43 CST

Original text of this message

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