oracle学习--循环语句
生活随笔
收集整理的這篇文章主要介紹了
oracle学习--循环语句
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| oracle學習--循環語句 |
| loop循環: create or replace procedure pro_test_loop is i number; begin i:=0; loop ? i:=i+1; ? dbms_output.put_line(i); ? if i>5 then ? ? exit; ? end if; end loop; end pro_test_loop; while循環: create or replace procedure pro_test_while is i number; begin i:=0; while i<5 loop ? i:=i+1; ? dbms_output.put_line(i); end loop; end pro_test_while; for循環1: create or replace procedure pro_test_for is i number; begin i:=0; for i in 1..5 loop ? dbms_output.put_line(i); end loop; end pro_test_for; for循環2: create or replace procedure pro_test_cursor is userRow t_user%rowtype; cursor userRows is select * from t_user; begin for userRow in userRows loop ? ? dbms_output.put_line(userRow.Id||','||userRow.Name||','||userRows%rowcount); end loop; end pro_test_cursor; |
總結
以上是生活随笔為你收集整理的oracle学习--循环语句的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 女子扮孕妇走私90部手机入境被当场查获
- 下一篇: MCSE认证全攻略(初、中、高)