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

Home -> Community -> Usenet -> c.d.o.server -> Re: Error handling

Re: Error handling

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 15 Sep 2006 07:14:53 -0700
Message-ID: <1158329691.558013@bubbleator.drizzle.com>


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

   END LOOP
END; HTH
-- 
Puget Sound Oracle Users Group
Received on Fri Sep 15 2006 - 09:14:53 CDT

Original text of this message

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