LOOP within a CASE statement
524947Aug 15 2006 — edited Aug 16 2006Hi 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