在oracle存储过程中怎样跳出本次循环

如题所述

exit跳出循环,你是说要continue的那,这个似乎没有,可以用if else 来解决。


begin
for i in 1..10 loop
  if i<>3 then
    dbms_output.put_line(i);
    if i=5 then
       exit;
    end if ;
  end if;
end loop;
end;

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2016-02-18
用exit关键字。
如:
declare
i int;
begin
i:=1;
while true
loop
dbms_output.put_line(i);
if i=100 then
exit;
end if;
i:=i+1;
end loop;
end;
相似回答