浅谈Oracle性能优化可能出现的问题(2)
从上面可以看出,普通情况下,exit只跳出当前层的循环。
SQL> BEGIN 2 <> 3 FOR v_outerloopcounter IN 1..2 LOOP 4 <> 5 FOR v_innerloopcounter IN 1..4 LOOP 6 DBMS_OUTPUT.PUT_LINE(Outer Loop counter is 7 || v_outerloopcounter || 8 Inner Loop counter is || v_innerloopcounter); 9 EXIT outerloop WHEN v_innerloopcounter = 3; 10 END LOOP innerloop; 11 END LOOP outerloop; 12 END; 13 / Outer Loop counter is 1 Inner Loop counter is 1 Outer Loop counter is 1 Inner Loop counter is 2 Outer Loop counter is 1 Inner Loop counter is 3 PL/SQL procedure successfully completed.
从上面可以看出,exit跳出了外层的循环。
相关新闻>>
- 发表评论
-
- 最新评论 更多>>