Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Process records in LOOP

499195Nov 3 2006 — edited Nov 3 2006
My logic is

cursor c1 is
SELECT col1,col2,...
FROM tab1

BEGIN

FOR c1_rec in c1 LOOP
IF some condition is satisfied THEN
delete the record
-- exit out if the condition is satisfied and go to next record in loop
END IF;
BEGIN
SELECT (some date)
INTO variable
FROM table 2
IF variable = some value THEN
DELETE operation
UPDATE operation
-- exit out if the condition is satisfied and go to next record in loop
END IF;
END;
END;

What i am trying to acheive is after i enter the loop i am working with a set of records based on the explicit cursor declared. Suppose i am with my first record and it has satisfied the condition of the first DELETE statement and i want to exit out and process the next record in the set instead of going further in the logic. How do i do this?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2006
Added on Nov 3 2006
5 comments
614 views