This content has been marked as final. Show 3 replies
923315 wrote:Correct. PL/SQL will re-initialize it and extend it. And re-initializing means you will lose all prior collection content. There is no option to bulk collect append (too bad).
so can you please confirm that these is no need to initialize and extend when we use bulk collect and nested table?
Bulk collecting into a collection variable automatically:
1) deletes any data present (if any) in that collection
2) initializes the collection if needed (nested tables)
3) extends the collection by the number of rows fetched (if needed again)
4) fills the collection starting with index 1 to the number of rows being fetched.
I haven't found a precise description of this behaviour in the doc, but the examples clearly show that you don't need to initialize the collection:
Yes, BULK COLLECT implicitly initialises and extends the receiving nested table.
but i have seen that when we use bulk insert we need to initialize constructor and use the extend functionality.Not sure what you're talking about. Bulk insert (i.e. FORALL) reads from a nested table, it has nothing to do with getting data into one.