oracle 判断游标是否为空

begin
       open cur_p;
       loop
       fetch cur_p into var_a,var_b;
       exit when cur_p%notfound;
      
       if cur_p%rowcount = 0 then
       begin
            --语句块1
            exception
                   when others then
                   null;
       end;
      
       else
       begin
            --语句块2
            exception
                   when others then
                   null;
       end;
       end if;

       end loop;
       close cur_p;
end;

猜你喜欢

转载自yuiop666.iteye.com/blog/2098331