if j=50 then
   exit;
end if;

解决方案 »

  1.   

    CREATE OR REPLACE procedure aa()
    as
       i number(20);
       j number(20);begin
       i:=0;
       j:=0;
       LOOP
       EXIT WHEN i=100;
            i:=i+1;
            select a into j from test where a='flag';
            if j=50 then
               goto continue;
            end if;
       END LOOP;
       <<continue>>
       null;
    end;
      

  2.   

    用exit也可以,不过用goto可以定位到任意位置.