Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: CASE under Oracle8i
Jonathan,
Oracle 8.1.7/Linux:
lpetrov_at_TESTDB> select * from v$version;
BANNER
lpetrov_at_TESTDB> show serveroutput
serveroutput ON size 2000 format WORD_WRAPPED
lpetrov_at_TESTDB> SELECT CASE
WHEN DUMMY='X' THEN 'Dual is OK'
ELSE 'Dual is messed up'
END
FROM DUAL;
CASEWHENDUMMY='X'
lpetrov_at_TESTDB> lpetrov_at_TESTDB>
lpetrov_at_TESTDB> 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;
12 /
SELECT CASE
*
ERROR at line 4:
ORA-06550: line 4, column 11:
PLS-00103: Encountered the symbol "CASE" when
expecting one of the following:
( * - + all mod null <an identifier>
<a double-quoted delimited-identifier> <a bind
variable>
table avg count current distinct max min prior sql
stddev sum
unique variance execute the forall time timestamp
interval
date <a string literal with character set
specification>
<a number> <a single-quoted SQL string>
Regards,
Lyubomir Petrov
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Lyubomir Petrov INET: lpetrov_at_yahoo.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 - 22:28:20 CST