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

Home -> Community -> Usenet -> c.d.o.misc -> Re: unable to catch Exception

Re: unable to catch Exception

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 10 May 2006 07:14:04 +0200
Message-ID: <2ht262l031mog7kkq8kcmi8fmbfpb82b8l@4ax.com>


On 9 May 2006 21:13:31 -0700, "sappi" <swapnareddy_09_at_yahoo.com> wrote:

>Hi All,
>
>I have a .sql file with declare..begin ..exception(no_data_found and
>when others).. end;
>
>In the above procedure , I am making use(invoke) of one more procedure
>which is using No_data_found exception and when_others.
>
>The problem i am am facing is ,the main procedure is not catching the
>exception as it is already dealt by the invoking(inside) procedure.
>
>I want the exception to be catched by the outside procedure so that i
>can log those errors into a table.
>
>In this case how can we catch the exception again which is already
>dealth by WHEN_OTHERS in the Inside procedure with out changing the
>inside(invoked) procedure exception(as it is used by other procedures).
>
>-sappi

begin
...

   begin
   ...
  exception
  when-others then
  ....
  raise -- reraise the exception
 end;
exception
when-others then

or (Less ugly)
convert the outer exception handler to an (autonomous) procedure and call it everywhere. No need to reraise anymore.

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed May 10 2006 - 00:14:04 CDT

Original text of this message

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