PL/SQL 循环
plsql中的循环写法
-- loop1
declare
total number(4) := 0;
begin
while total <= 100 loop
total := total + 1;
dbms_output.put_line(total);
end loop;
end;
-- loop2
declare
total number(4) := 0;
begin
loop
exit when total = 100;
total := total + 1;
dbms_output.put_line(total);
end loop;
end;
-- loop3
declare
total number(4) := 0;
begin
for total in 1 .. 50 loop
dbms_output.put_line(total);
end loop;
end;