Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: CASE under Oracle8i

RE: CASE under Oracle8i

From: Deshpande, Kirti <kirti.deshpande_at_verizon.com>
Date: Sun, 24 Mar 2002 21:03:19 -0800
Message-ID: <F001.00431B61.20020324210319@fatcity.com>


Jonathan,

You are correct.

The first form works with SQL in 8i.

The second form does not work in 8i, but works in 9i.

-----Original Message-----
Sent: Sunday, March 24, 2002 9:18 PM
To: Multiple recipients of list ORACLE-L

If you run Oracle8i, and could conveniently test a couple of statements for me, I'd appreciate it.

First, I believe the following should work under Oracle8i:

SELECT CASE
WHEN DUMMY='X' THEN 'Dual is OK'
ELSE 'Dual is messed up'
END
FROM DUAL; I'm less certain about the following, which I vagualy recall hearing might not work under Oracle8i, but which does work under Oracle9i:

DECLARE
   dual_message VARCHAR2(20);
BEGIN
   SELECT CASE
   WHEN DUMMY='X' THEN 'Dual is OK'
   ELSE 'Dual is messed up'
   END INTO dual_message
   FROM DUAL;
   DBMS_OUTPUT.PUT_LINE(dual_message);
END; Be sure to SET SERVEROUTPUT ON before executing the above. Otherwise you won't see the results.

The point of all this is that I seem to recall hearing that, while SQL in 8i supported the CASE statement, that SQL within PL/SQL did not. I'm trying to verify the truth or falsity if that statement.

Jonathan Gennick --- Brighten the corner where you are mailto:jonathan_at_gennick.com
http://Gennick.com * http://MichiganWaterfalls.com * http://ValleySpur.com
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Jonathan Gennick
  INET: listmail_at_gennick.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Deshpande, Kirti
  INET: kirti.deshpande_at_verizon.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Sun Mar 24 2002 - 23:03:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US