|Dynamic sql [message #387421]
||Thu, 19 February 2009 03:41
Registered: January 2007
im facing one problem.
I have one table called "temp". it has column "query". It contains sql statements.
I need to execute this sql statement and fetch the results into one table type variable.
Finally i have to export this data into single dimention array.
Note: i dont know how many columns in sql stament, but i know only one set of records it will retrieve.
I have one table variable like this:
TYPE varchar_table IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER;
tab_result varchar_table ;
i have query like 'select ename, job, manager from emp where emp_id = 1001;'
we got the result for this query as below:
ename job manager
----- ------- ---------
ADAMS CLERK DAVID
Now i have to add this data into tab_result variable which is of array type;
O/p should be like this:
Please help me to solve this problem.