Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: what is the SQL equivalent of 'continue' and 'break' in C ?
happyardy_at_gmail.com wrote:
> Scott wrote:
>> happyardy_at_gmail.com wrote: >>> what is the SQL equivalent of 'continue' and 'break' in C ? >>> >>> like can I do this... >>> >>> >>> for counter in 1..10 >>> if(something something) >>> ( if (something) >>> ( if(something) >>> then continue; >>> >>> //Rest of the for loop >>> >>> end loop; >>> >>> Would it start the next iteration without processing the rest of the >>> loop ? >>> >>> thanks >>> - Ardy >> If I understand the question, something like this in PL/SQL >> >> loop >> >> loop >> if something >> then >> exit; -- continue, i.e. go on with the rest of the main loop >> end if; >> >> end loop; >> >> if something_else >> then >> exit; -- break, i.e. get out of the main loop >> end if; >> -- rest of the for loop >> >> end loop;
If you want GOTO capability in Oracle use a label.
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/goto_statement.htm#LNPLS01323
I don't have any demos in the library that I can recall as I find them rather inelegant.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Wed Aug 09 2006 - 13:40:14 CDT