Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Why doesn't this cure my ORA-04030?
I'm using
FETCH ... BULK COLLECT INTO
and then subsequently
FORALL ... INSERT INTO Very cool, very fast. However, I found that if my base population was too large, that I would get ORA-04030 somewhere in the process.
So, I decided to loop the entire process and just do a portion of the base population on each pass.
I can go through a number of passes in this manner, but I still end up getting ORA-04030. Why? Shouldn't the TABLEs I'm BULK COLLECTing into release their memory after each pass? Each pass has no more data involved than the first, and that one (and many after) go just fine.
__sample code__
FOR batch in 1 .. num_batches
LOOP
OPEN c_cursor
( f_func1( ... batch ) ,f_func2( ... batch ) ); FETCH c_cursor BULK COLLECT INTO tab_foos
FORALL j IN tab_foos.FIRST .. tab_foos.LAST
INSERT INTO table_name ( field1 ,field2 ) SELECT ... WHERE ... ... = tab_foos(j) ...; tab_foos.DELETE;
![]() |
![]() |