1. 程式人生 > >『ORACLE』 PLSQL-LOOP基本循環(11g)

『ORACLE』 PLSQL-LOOP基本循環(11g)

lin line size pan 循環 dbm plsql out -s

SQL> declare
2 i number := 0;
3 begin
4 loop
5 dbms_output.put_line(i);
6 i := i+1;
7 exit when i = 10;
8 end loop;
9 end;
10 /
0
1
2
3
4
5
6
7
8
9

PL/SQL procedure successfully completed.

SQL> declare
2 i number := 0;
3 begin
4 loop
5 i := i+1;
6 dbms_output.put_line(i);


7 exit when i = 10;
8 end loop;
9 end;
10 /
1
2
3
4
5
6
7
8
9
10

PL/SQL procedure successfully completed.

『ORACLE』 PLSQL-LOOP基本循環(11g)