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!

LOOP within a CASE statement

524947Aug 15 2006 — edited Aug 16 2006
Hi everybody,

In a procedure, i have to compare a defined value (var1) with a collection of value selected from a table. the value are in a cursor.
The followings codes dont work:

j NUMBER :=1;
var1 NUMBER := '1234';
..........
WHILE j < 16 LOOP
CASE var1
WHEN cursor(j).var2 THEN action.....
END CASE;
j:=j+1;
END LOOP;
....
END;


I have 16 values of var2, but it could be more, and the code look much better without the lines to compare the 16 values....
I already try to include the loop within the case, but no compilation possible....

If somebody has an idea...

Thx in advance....

Alex
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2006
Added on Aug 15 2006
12 comments
2,791 views