plsql loop用法
来源:互联网 发布:grub2 引导centos iso 编辑:程序博客网 时间:2024/06/07 12:44
PL/SQL的三种形式的循环:
1.LOOP(无条件循环):
loop
statements;
end loop;
2.WHILE(有条件循环):
while condition loop
statements;
end loop;
3.FOR(固定次数循环):
for counter in value1 .. value2
loop
statements;
end loop;
实例:分别用三种循环输出1-100
loop:
while:
for:
1.LOOP(无条件循环):
loop
statements;
end loop;
2.WHILE(有条件循环):
while condition loop
statements;
end loop;
3.FOR(固定次数循环):
for counter in value1 .. value2
loop
statements;
end loop;
实例:分别用三种循环输出1-100
loop:
- declare i number;
- begin
- i := 1;
- loop
- if i > 100 then
- goto quit;
- end if;
- dbms_output.put_line(i);
- i := i + 1;
- end loop;
- <<quit>>
- null;
- end;
- declare i number;
- begin
- i := 1;
- loop
- if i > 100 then
- goto quit;
- end if;
- dbms_output.put_line(i);
- i := i + 1;
- end loop;
- <<quit>>
- null;
- end;
while:
- declare
- i number;
- begin
- i := 1;
- while i<=100 loop
- dbms_output.put_line(i);
- i := i+1;
- end loop;
- end;
- declare
- i number;
- begin
- i := 1;
- while i<=100 loop
- dbms_output.put_line(i);
- i := i+1;
- end loop;
- end;
for:
- declare
- i number;
- begin
- for i in 1..100
- loop
- dbms_output.put_line(i);
- end loop;
- end;
- plsql loop用法
- Oracle/PLSQL: FOR Loop
- Oracle/PLSQL: While Loop
- plsql loop循环
- PLSQL Cursor For Loop
- Oracle/PLSQL: Repeat Until Loop
- Oracle/PLSQL: CURSOR FOR Loop
- plsql 用法
- Oracle/PLSQL: FOR Loop 循环语句
- PLSQL 循环游标 cursor loop fetch into
- plsql编程 循环示例 LOOP FOR WHILE
- plsql decode的用法
- PLSQL decode的用法
- PLSQL:MERGE的用法
- Oracle PLsql table用法
- PLSQL 循环游标 cursor loop fetch into【转载】
- PLSQL Cursor For Loop handle header and detail
- PLSQL编程4:plsql游标的用法
- 第十周上级任务--求1000以内所有偶数的和
- 第十周上机任务(分数的累加)
- shell 里 awk print 的用法
- linux5.4配置
- 富翁与陌生人换钱游戏
- plsql loop用法
- 由浅入深探究mysql索引结构原理、性能分析与优化
- 呵呵
- 爱的太深终究会是伤 莫沧分享伤感日志
- 简明教程:架设 PPTP VPN 及在 Linux 上远程连接 VPN
- Codeforces Problemset 30D(#30 div.1 D)
- C++里的静态(static)成员函数(不能用const的原因+static在c++中的第五种含义)
- js在ie与firefox中不兼容的问题总结
- 2-1000内的完数,亲