| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Howto do Whenever error in PL/SQL
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....
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
![]() |
![]() |