Search notes:

ORA-06592: CASE not found while executing CASE statement

create or replace function tq84_no_ora_06592(id integer) return varchar2 authid definer is
begin
 
   return
   case id
      when '0' then 'zero'
      when '1' then 'one'
      when '2' then 'two'
   end;
  
end tq84_no_ora_06592;
/
 
 
create or replace function tq84_ora_06592(id varchar2) return varchar2 authid definer is
   ret  varchar2(20);
begin
 
   case id
      when 0 then ret := 'null';
      when 1 then ret := 'eins';
      when 2 then ret := 'zwei';
   end case;
  
   return ret;
  
end tq84_ora_06592;
/
This statement runs without error, the function tq84_no_ora_06592 just returns null:
begin
   dbms_output.put_line(tq84_no_ora_06592(3));
end;
/
The following statement throws ORA-06592: CASE not found while executing CASE statement:
begin
   dbms_output.put_line(tq84_ora_06592(3));
end;
/
Cleaning up:
drop function tq84_no_ora_06592;
drop function tq84_ora_06592;

See also

Other Oracle error messages

Index