Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: CONTINUE loop
Thorsten Kettner wrote:
>
> Hi, I am rather new with PL/SQL and wonder if there isn't a CONTINUE
> statement like in other languages, to skip statements in a loop and
> continue with the next iteration. Please look at my very simple example
> to clearify what I mean. I use GOTO and a lable instead and even need a
> dummy command to be allowed to use the lable at the end of the loop:
>
> FOR lrec_emp IN curs_emp LOOP
> {some processing for any employee}
> IF lrec_order.dept_id <> ln_dept_id THEN
> GOTO NextEmp;
> END IF;
> {some processing for employees of the given departement}
> <<NextEmp>>
> ln_dummy := ln_dummy;
> END LOOP;
>
> Sent via Deja.com
> http://www.deja.com/
You just need to rethink your code:
for lrec_emp in curs_emp LOOP
---processing for all employees
if lrec_order.dep_id = ln_dept_id then
--processing for employees of given department--
end if
ln_dummy := ln_dummy
end loop;
Received on Mon Jan 08 2001 - 11:37:11 CST
![]() |
![]() |