代码改变世界

邪恶的PLS-00103错误提示

2011-05-23 20:48  潇湘隐者  阅读(53128)  评论(2编辑  收藏  举报

今天碰到一个存储过程编译错误,提示PLS-00103错误,关于这个错误网上能搜到一大把,原因很多,我碰到的错误提示如下:

Compilation errors for PROCEDURE ETL.PRO_TM_WG_NETSEV_PV

Error: PLS-00103: 出现符号 "EXCEPTION"在需要下列之一时:
        begin case declare
          end exit for goto if loop mod null pragma raise return select
          update while with <an identifier>
          <a double-quoted delimited-identifier> <a bind variable> <<
          close current delete fetch lock insert open rollback
          savepoint set sql execute commit forall merge pipe
Line: 194

Error: PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
        end not pragma
          final instantiable order overriding static member constructor
          map
Line: 203

对于这个错误提示,还真是摸不着头脑,最后检查时才悲催的发现错误就在IF ELSIF ...结构不小心写成了 IF ELSE IF 形式。结果报了个让人摸不着头脑的错误。由于存储过程涉及业务,为了简单说明,我用一个简单存储过程模拟错误存储过程如下所示。希望下次大家碰到这个问题,不要悲催的在哪里郁闷!