[Oracle] 循环的几种方式
2017-10-06 00:00
253 查看
-- goto declare x number; begin x:=9; <<repeat_loop>> x:=x-1; dbms_output.put_line('x: '||x); if x>0 then goto repeat_loop; end if; end; -- for declare x number; begin x:=1; for x in reverse 1..10 loop dbms_output.put_line('x: '||x); end loop; dbms_output.put_line('end loop x: '||x); end; -- while declare x number; begin x:=0; while x < 10 loop dbms_output.put_line('x: '||x); x:=x+1; end loop; dbms_output.put_line('end while:x '||x); end; -- loop declare x number; begin x:=0; loop x:=x+1; exit when x>9; dbms_output.put_line('x: '||x); end loop; dbms_output.put_line('end loop x: '||x); end;
参考:
http://blog.sina.com.cn/s/blog_710faf420100zc6v.html
相关文章推荐
- [Oracle] 循环的几种方式
- MyBatis+Oracle实现主键自增长的几种常用方式
- .net 连接oracle的几种方式
- 启动Oracle服务的几种方式
- Oracle中函数/过程返回结果集的几种方式
- C#连接oracle的几种方式《转》
- 连接Oracle的几种方式
- Oracle&nbsp;几种启动方式的区别
- ArrayList和LinkedList的几种循环遍历方式及性能对比分析
- Oracle重做日志丢失或破坏后的几种恢复方式
- Oracle中函数/过程返回结果集的几种方式
- 【oracle游标二】游标循环方式
- oracle启动和关闭数据库的几种方式
- net 连接oracle的几种方式
- oracle导入导出数据的几种方式
- C# 连接 Oracle 的几种方式
- Swift中解决闭包循环引用的几种方式
- oracle中循环游标的方式
- ArrayList和LinkedList的几种循环遍历方式及性能对比分析
- C# 连接 Oracle 的几种方式