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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759473798, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-06592_CASE-not-found-while-executing-CASE-statement(81): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78