declare
i integer;
s integer;
begin
i:=1;
s:=0;
loop
s:=s+1;
exit when i <11;
end loop
dbms_output.put_line(s);
end;
------解决方案--------------------
declare
i integer;
s integer;
begin
i:=1;
s:=0;
loop
s:=s+1;
exit when i <11;
end loop;
dbms_output.put_line(s);
end;
end loop 少了;
楼主粗心啦!
------解决方案--------------------
是的,楼主太粗心了。
------解决方案--------------------
是啊 少 分号
------解决方案--------------------
不单单是少;号!而且退出条件应该是i> =11;
------解决方案--------------------
还有你怎么不让i=i+1;
------解决方案--------------------
declare
ctrl integer:=0;
begin
dbms_output.enable;
loop
dbms_output.put(ctrl || ' ');
ctrl:=ctrl+1;
exit when ctrl=10;
end loop;
dbms_output.put_line ( ' ');
end;
/
------解决方案--------------------
顶!
------解决方案--------------------
declare
i integer;
s integer;
begin
i:=1;
s:=0;
loop
s:=s+1;
i:=i+1;
exit when i <11;
end loop;
dbms_output.put_line(s);
end;