Dynamic variables in PLSQL
Hi
I have a dynamic SQL which returns multiple columns and the count of these columns may vary.
The query may return 2/3/4/5/..../20 columns depending upon the data present in the database.
Eg: The query may return select c1,c2 from dual or select c1,c2,c3 from dual.
I'm trying to hold these values in individual variables as follows:
OPEN c1;
FETCH c1 INTO x1,x2,x3;
The problem statement is that I need to get the exact match of columns and variables to hold them.
Is there any thing like horizontal table type which holds data irrespective of the number of columns( something like ARRAYS in JAVA).