Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Error handling
devjnr_at_gmail.com wrote:
> I'm trying to handle exception inside a loop, but I should continue
> with the loop after handle the exception:
>
>
> ------------------------------------------------
> declare
> excTest exception;
> lvIdx pls_integer;
> begin
>
> lvIdx := 5;
>
> while (lvIdx < 10)
> loop
>
> dbms_output.put_line(lvIdx);
> raise excTest;
> lvIdx := lvIdx + 1;
>
> end loop;
>
> exception
>
> when excTest then
>
> begin
> dbms_output.put_line('1) exception');
> end;
>
> when others then
>
> begin
> dbms_output.put_line('2) unhandled exception');
> end;
>
> end;
> ------------------------------------------------
>
>
> The problem is that I would loop until "lvIdx" is < 10....
>
> I think it should be possible....or not?
>
> Thx.
BEGIN
LOOP
BEGIN --processing here EXCEPTION WHEN .... -- handle exception here END
-- Puget Sound Oracle Users GroupReceived on Fri Sep 15 2006 - 09:14:53 CDT
![]() |
![]() |