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 statement

Re: CASE statement

From: Jared Still <jkstill_at_cybcon.com>
Date: Tue, 29 Jan 2002 22:57:51 -0800
Message-ID: <F001.003FFF04.20020129222517@fatcity.com>

This sounds like a SQL feature that has not made it into the PL/SQL engine as yet. There are a number of statistical functions such as regr_slope and regr_intercept that work in SQL, but not in PL/SQL.

They are supposed to be in PL/SQL as of 9i, though I haven't checked myself.

One way to work around this is to use EXECUTE IMMEDIATE in your PL/SQL so that the SQL engine must parse it.

Jared

On Tuesday 29 January 2002 21:30, Ghadge,Sameer wrote:
> 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: Jared Still
  INET: jkstill_at_cybcon.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 Wed Jan 30 2002 - 00:57:51 CST

Original text of this message

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