Is there a way to do a "for each" in oracle, something like this:
begin
for VAR in {1,2,5}
loop
dbms_output.put_line('The value: '||VAR);
end loop;
end;
I know you can do something like:
begin
for VAR in 1..5
loop
if VAR in(1,3,5) then
dbms_output.put_line('The value: '||VAR);
end if;
end loop;
end;
But isn't there a way to do this in a nicer way? Defining a set of values and iterating through them?
Thanks.