在 Oracle 过程中使用 CASE 语句不起作用

Using CASE statement in Oracle procedure not working

我在下面写了 CASE 语句来让我的逻辑起作用。但它不起作用并给我错误

Error(224,122): PLS-00103: Encountered the symbol ")" when expecting one of the following: * & = - + < / > at else end in is mod remainder not rem when <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset The symbol "end" was substituted for ")" to continue.

下面是我的代码:

V_AMTINMONTH := (CASE V_DATEVAR_VALUE WHEN 'START' THEN V_AMTINMONTH WHEN 'END' THEN (V_AMTINMONTH - V_NOOFDAYSINMONTH + 1));

尝试

v_amtinmonth :=
  CASE
     WHEN v_datevar_value = 'START'
     THEN
        v_amtinmonth
     WHEN v_datevar_value = 'END'
     THEN
        v_amtinmonth - v_noofdaysinmonth + 1
  END;