日期:2014-05-17 浏览次数:20876 次
set serverout on declare x number; begin x:=0; loop exit when x>=10;--当x>=10退出循环 x:=x+1;--x每次增加1; continue when x>5;;--当x>5,进入下次循环 dbms_output.put_line(x);--打印1到5 end loop; end;
------解决方案--------------------
declare
x number;
begin
x:=0;
loop
exit when x>=10;
x:=x+1;
if x>5 then
continue;
end if;
dbms_output.put_line(x);
end loop;
end;