Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL question
Hello,
Is it possible to use a variable in the select statement which holds the column I want to select?
So:
declare
range number; column_name varchar2(10);
for range in 1..48 loop
column_name := halfhour||range;
select column_name from some_table;
end loop;
end;
/
I need this to select a column halfhour1 until halfhour48, so I need to give the number at the end of the column_name.
Any idea's?
Rolf. Received on Fri Sep 16 2005 - 10:48:54 CDT
![]() |
![]() |