I'm trying to use the contents of a string variable to identify a column name in pl/sql. Is this possible?
In a collection, I have column c003 which contains the column name in a different collection, ie.. c001.
In my pl/sql, I am trying to retrieve that value and use it in a query, like this:
declare
date_col varchar2(5);
begin
select c003 into date_col from apex_collections where collection_name = 'MY_COLLECTION' and c004 = 'DATE';
-- date_col now contains 'c002'
for c1 in (select seq_id, **date_col** from apex_collections where collection_name = 'DATA_COLLECTION')
loop
-- process row
end loop;
end;
Is this possible?
Thanks