Home » SQL & PL/SQL » SQL & PL/SQL » case_not_found exception error (oracle 10g)
case_not_found exception error [message #581101] Tue, 02 April 2013 03:40 Go to next message
pankajdurve
Messages: 18
Registered: April 2013
Location: MUMBAI
Junior Member
Laughing

please any one can tell me example of case_not_found exception by using case statement...?
Re: case_not_found exception error [message #581102 is a reply to message #581101] Tue, 02 April 2013 03:47 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
What is funny in this question?

ORA-06592: "CASE not found while executing CASE statement"
 *Cause:  A CASE statement must either list all possible cases or have an
          else clause.
 *Action: Add all missing cases or an else clause.

Regards
Michel
Re: case_not_found exception error [message #581103 is a reply to message #581102] Tue, 02 April 2013 03:49 Go to previous messageGo to next message
pankajdurve
Messages: 18
Registered: April 2013
Location: MUMBAI
Junior Member
ok...but how to implemented it by an example in pl/sql
Re: case_not_found exception error [message #581104 is a reply to message #581103] Tue, 02 April 2013 03:59 Go to previous messageGo to next message
Littlefoot
Messages: 21824
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What a strange requirement ... you want to implement an ERROR?!? Why?

Anyway, here you go:
SQL> declare
  2    l_res varchar2(1);
  3  begin
  4    case when 1 = 2 then l_res := 'A';
  5         when 1 < 0 then l_res := 'B';
  6    end case;
  7  end;
  8  /
declare
*
ERROR at line 1:
ORA-06592: CASE not found while executing CASE statement
ORA-06512: at line 4


SQL>
Re: case_not_found exception error [message #581106 is a reply to message #581104] Tue, 02 April 2013 04:01 Go to previous message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
It is just an homework... and you did it for him. Smile

Regards
Michel
Previous Topic: Finding Numeric , aplhanumeric , character
Next Topic: HANDLING INVALID_CURSOR ERROR
Goto Forum:
  


Current Time: Fri May 23 23:25:38 CDT 2025