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: EXIT vs EXIT WHEN

Re: EXIT vs EXIT WHEN

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 11 May 1998 10:41:19 GMT
Message-ID: <3556d514.13259335@192.86.155.100>


A copy of this was sent to gennick_at_worldnet.att.net (Jonathan Gennick) (if that email address didn't require changing) On Mon, 11 May 1998 03:40:02 GMT, you wrote:

>PL/SQL allows you to exit a loop using either of the
>following:
>
> EXIT
> EXIT WHEN
>
>Why? I can't think of a single case where plain EXIT is
>superior to EXIT WHEN. So why are both allowed? Was there
>some backwards compatibility issue here? Did early versions
>of PL/SQL not support EXIT WHEN?
>
>

for i in 1 .. 10000

   do something
   if ( this that or the other thing ) then

       do some cleanup
       exit;

   end if;
end loop;

its useful when you want to perform some additional logic upon detecting the fact that you want to exit the loop for example.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon May 11 1998 - 05:41:19 CDT

Original text of this message

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