declare cursor aaa is
select * from a因为有时候会timeout,如果timeout 则
declare cursor aaa is
select * from bfor bbb in aaa loop
......
end;怎么实现?

解决方案 »

  1.   

    使用光标FOR循环罢。
    把主要内容放到创建存储过程的体中。
    create or replace procedure (形参列表) isbegin
        body代码。
    end;
      

  2.   

    declare cursor aaa is
    select * from a
    exception when others then
    declare cursor aaa is
    select * from b这样写不对
      

  3.   

    select * from a
    ---看看有没有帮忙优化这个SQL!
      

  4.   

    a 表是在其他服务器上的,所以即便优化也会出现timeout
      

  5.   

    CREATE OR REPLACE PROCEDURE BUPIN.PR_BLRETURN_HAND
    (传入的参数)
    is 
    变量1;
    变量2;
    exception;begin
    when exception then
    .....
    end