I'm trying to check value of variable in case statement in following code:
declare
v_switch varchar2(9) ;
begin
case v_switch
when v_switch = 'one' then dbms_output.put_line('one');
when v_switch = 'two' then dbms_output.put_line('two');
when v_switch = 'three' then dbms_output.put_line('three');
else dbms_output.put_line('null');
end case;
end;
but oracle returns:
Error report -
ORA-06550: line 5, column 6:
PLS-00615: type mismatch found at 'V_SWITCH' between CASE operand and WHEN operands
What caused this error?