Bulk collect inside a loop [message #546694] |
Thu, 08 March 2012 04:16  |
 |
rsreejithmenon
Messages: 9 Registered: February 2012 Location: Bangalore
|
Junior Member |
|
|
Hi,
I have a select..bulk collect into clause which is inside a for loop as the query gets a parameter from the loop, Then, how to extend the collection rows for each iteration.
My collection is of a sql object type.
thanks
Sreejith
|
|
|
|
|
|
|
Re: Bulk collect inside a loop [message #546701 is a reply to message #546694] |
Thu, 08 March 2012 05:10  |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
Then you have to use two collections - the temporary one for obtaining data with BULK COLLECT, the permanent one for storing final result set. Using MULTISET UNION operator for continuous adding values from the first to the second one should be the best choice.
You may find more details in PL/SQL User's Guide and Reference book for your Oracle version. It is available with other Oracle documentation e.g. online on http://tahiti.oracle.com/
Please, consult it.
|
|
|