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: Howto do Whenever error in PL/SQL

Re: Howto do Whenever error in PL/SQL

From: Dave Fowler <d.fowler_at_smmj.com>
Date: Wed, 23 May 2001 16:29:38 GMT
Message-ID: <SzRO6.26014$BN6.1170108@newsread1.prod.itd.earthlink.net>

Amos,
 Put a begin exception end block around the execute immediate statement to catch errors.
 e.g
procedure your_sp
..
begin
.... your code
  begin

        execute immediate your_dyn_sql ;    exception

      when others then
             ...insert into....

  end;
... more code in sp

exception
 when others ....

end; -- your_sp

"Amos" <amos_987_at_hotmail.com> wrote in message news:9eggs8$ql6$1_at_news.inter.net.il...
> Hi,
>
> I'm doing a lot of execute immediate a loop inside a procedure.
> My problem is that if one of the exec fails, the SP terminates.
> What I want to do is something like whenever error do ... insert the
> statement that failed into an exception table and continue to exec the
 next
> command.
>
> Is there a way to do it in PL/SQL ??
>
>
> Cheers,
> Amos
>
>
>
Received on Wed May 23 2001 - 11:29:38 CDT

Original text of this message

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