Hello,
I have a table with the following structure
column name datatype
name varchar2(10)
address varchar2(10)
age number
although the following code is wrong i am pasting it here so that you can understand what i clearly want..
if (field%type== varchar2()) then
execute immediate ' select field from emp into result1;
for i in 1..result1.count loop
dbms_output.put_line(result1(i));
elsif (field%type==number) then
execute immediate ' select field from emp into result2;
for i in 1..result2.count loop
dbms_output.put_line(result2(i));
end loop;
endif;
end;
lets think here 'field (used in if condition) 'is some dynamic column name .now i want to store the results in result 1 and result 2 based on datatypes of column.. how is this possible?