I am trying to write a procedure in Oracle PL/SQL that looks like below snippet:
> LOOP:
>READ INPUT FROM CURSOR
>GET OUTPUTS USING SELECT QUERY(OUTPUT RECORD COUNT MAY VARY ON EACH ITERATION)
>APPEND OUTPUT TO SOME DATA STRUCTURE
> END LOOP;
>RETURN DATA STRUCTURE
Actually I am stuck with this appending task. In each iteration different number of output will be available using a select query. I want to append all of the records in a single data structure.
Suppose inner select query return 3 columns ColA,ColB,ColC and the loop iterates 2 times. Then in 1st iteration it returns:
1,2,3
3,4,5
In the next iteration it returns 4,5,7.
The procedure will return some data structure containing below:
1,2,3
3,4,5
4,5,7
Is there any way?