回答

收藏

Oracle批量收集问题

技术问答 技术问答 372 人阅读 | 0 人回复 | 2023-09-12

我遇到了一个大的收sql我希望你能提供帮助。! l5 B8 F8 n8 U% [  `, A
使用以下代码:
2 I. h0 G$ ?6 f0 s8 q) u( V0 Zdeclare    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行。3 _9 D: `4 A( v+ ^6 v0 a1 J
然而,代码处理53000行,然后结束。在检索最后166条记录时,似乎会出现故障。
3 A- l) b: p6 q+ v( ]如果发现记录少于1000条,提取物是否会返回%notfound?我应该把出口移到循环的末尾吗?(我会尝试这种方法,但它需要3个小时才能到达故障点。
" G" u# ]8 J- L& F5 @提前致谢。
  c/ b* M1 y; f( Y5 J% |, {( ]                                                               
0 v2 O5 h9 j/ j    解决方案:
分享到:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则