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

Home -> Community -> Mailing Lists -> Oracle-L -> CASE statement

CASE statement

From: Ghadge,Sameer <Sameer_Ghadge_at_Syntelinc.com>
Date: Tue, 29 Jan 2002 21:44:21 -0800
Message-ID: <F001.003FFED3.20020129213018@fatcity.com>

hi,
 Oracle 8.1.6 supports the embedded CASE operator in an SQL statement.

But when i use it inside cursor, it gives error PLS-00103: Encountered the symbol "CASE" when expecting one of the following:

e.g.
declare
cursor c is select ename ,

   case when deptno = 10 then

'TEN'

        when deptno = 20 then

'TWENTY'
else
'other'
end dept

ename from emp ;
begin
for r in c loop
 dbms_output.put_line('Name :'|| r.ename); end loop;
end
/

So that means we cannot use CASE in cursor ???

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ghadge,Sameer
  INET: Sameer_Ghadge_at_Syntelinc.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 Tue Jan 29 2002 - 23:44:21 CST

Original text of this message

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