首页 > 解决方案 > PLS-00103:遇到符号“ELSE”

问题描述

我遇到了这个问题。

 case room_rec.roomID
 37        when null
 38        then v_counter := v_counter
 39        else  v_counter := v_counter+1
 40       end as counter;

显示此错误消息

LINE/COL ERROR
-------- -----------------------------------------------------------------
39/7     PLS-00103: Encountered the symbol "ELSE" when expecting one of
         the following:
         . ( * @ % & = - + ; < / > at in is mod remainder not rem
         <an exponent (**)> <> or != or ~= >= <= <> and or like like2
         like4 likec between || multiset member submultiset
         The symbol ";" was substituted for "ELSE" to continue.

40/6     PLS-00103: Encountered the symbol "END" when expecting one of the
         following:
         * & = - + ; < / > at in is mod remainder not rem
         <an exponent (**)> <> or != or ~= >= <= <> and or like like2

我希望明智地运行此案例,但错误消息弹出多次。

标签: sqloracle

解决方案


您的代码应该是:

v_counter := case when room_rec.roomID is null
             then v_counter
             else v_counter+1
             end;

推荐阅读