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

Home -> Community -> Usenet -> c.d.o.tools -> Re: CONTINUE loop

Re: CONTINUE loop

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Mon, 08 Jan 2001 12:37:11 -0500
Message-ID: <3A59FAC7.FCF0859E@Unforgetable.com>

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

Original text of this message

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