Dynamic Column name in a Cursor
720285Jul 14 2010 — edited Jul 23 2010Hello there,
How can I access data in cursor's field with dynamic fields names, more illustration follows:
My table has columns named as C1,C2,C3 so on
defined a cursor cursor_name on that table,
I need to access the fields by a loop like this:
OPEN cursor_name;
Fetch cursor_name into rec;
for i in 1 .. 10 loop
if rec.ci = 1Then
.....
end if;
end loop
close cursor_name;
where rec,ci represents the name of the cursor fields, so that I loop over them,
how can I implement such an idea,
thanks in advance
regards