11g新增continue语句.

4695阅读 1评论2010-10-19 TOMSYAN
分类:Oracle

刚开始学ORACLE的时候,用continue就不行,后来知道oracle里没有continue。
一直不理解ORACLE为什么没有加入continue原因。11G之后,ORACLE终于引入了continue.


SQL> declare
  2    total int:=0;
  3  begin
  4    for i in 1..10 loop
  5      if mod(i,2)=0 then
  6        continue;
  7      end if;
  8      total:=total+i;
  9    end loop;
 10    dbms_output.put_line(total);
 11  end;
 12  /
25

PL/SQL procedure successfully completed.

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

上一篇:诊断工具,等待事件,SQL优化原则
下一篇:Oracle统计信息的收集、管理与清除(作者EYGLE)

文章评论