Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Does CASE clause works in Oracle 8174-Pls guide
"KP" <ykutanoor_at_rediffmail.com> wrote in message
news:1119333666.447418.281990_at_g47g2000cwa.googlegroups.com...
> I am implementing a SQL script in Orcale that involves a CASE statement
> .
Oracle 8.1.7.4 supports CASE only in SQL.
Oracle 8.1.7.4 does not support CASE in PL/SQL (even in the cursor and
select into statements).
You have to use DECODE pseudo column instead.
Something like:
decode(AB.EffDateStart,
decode(AB.PeriodStatus, c_future , CP.BegEndEnd,CP.BegEndStart) ,0 , 1)
> The server is Oracle is 8174 and this piece of code runs well in Oracle
> 9i.
> Piece of code :
>
>
> CASE WHEN AB.EffDateStart = (
> CASE WHEN AB.PeriodStatus = c_future
> THEN CP.BegEndEnd
> ELSE CP.BegEndStart
> END)-- 6/1/2005 == 6/1/2005
> THEN 0-- So here it will take 0
> ELSE 1
> END
>
>
> The error is as follows:
>
> ORA-06550: line 111, column 18: PLS-00103: Encountered the symbol
> "CASE"
> when expecting one of the following: ( - + mod not null others <an
> identifier> <a double-quoted delimited-identifier> <a bind variable>
> avg
> count current exists max min prior sql stddev sum variance execute
> forall time timestamp interval date <a string literal with character
> set
> specification> <a number> <a single-quoted SQL string>
> ***** SCRIPT stopped due to error *****
>
>
>
> Can Somebidy tell me where is the problem so I can execute this
> successfully in Oracle 8174.Note this works superb in Oracle 9i
> Although this is simple question,pls answert.Thanks in advance
>
Received on Tue Jun 21 2005 - 01:28:31 CDT