我遇到了一个大的收sql我希望你能提供帮助。 % c& t: G. ~- H8 [3 r% C9 |使用以下代码: 2 A5 i( U. P ^2 }6 ^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 exit when c1%notfound; for i in 1..v_array_cust.count loop --Do some processing here. end loop; end loop;end;/游标c1返回53166行。' P% u3 L4 B$ \0 n
然而,代码处理53000行,然后结束。在检索最后166条记录时,似乎会出现故障。4 f! u- g6 i, R% O
如果发现记录少于1000条,提取物是否会返回%notfound?我应该把出口移到循环的末尾吗?(我会尝试这种方法,但它需要3个小时才能到达故障点。 * ?5 p2 g" ~( z2 @2 R提前致谢。 7 V# z+ S) o- q 3 ^+ A. g8 U! [' E" I8 X 解决方案: