Hi Oracle experts.
I'm having a little issue with a piece of bulk collect sql that I was hoping you could help out with.
With the following code:
declare
cursor c1
is
select customer,product
from products;
type type_cust is table of products.customer%type;
type type_prod is table of products.product%type;
v_array_cust type_cust;
v_array_prod type_prod;
begin
open c1;
loop
fetch c1
into v_array_cust, v_array_prod
limit 1000;
exit when c1%notfound;
for i in 1..v_array_cust.count
loop
--Do some processing here.
end loop;
end loop;
end;
/
The cursor c1 returns 53166 rows.
However, the code process 53000 rows and then ends. It seems that when going to retrieve the last 166 records there is some sort of failure.
Will the fetch return %notfound if it find's less than 1000 records? Should I move the exit to the end of the loop? (I am going to try this but it is deep in a piece of code that take 3 hours to get to the failure point.)
Thanks in advance.