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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL problem

Re: PL/SQL problem

From: Jan Gelbrich <j_gelbrich_at_westfalen-blatt.de>
Date: Wed, 5 Feb 2003 08:27:48 +0100
Message-ID: <b1qefp$159836$1@ID-152732.news.dfncis.de>


DECODE can only be used in a SQL statement, but not within PL/SQL.

Source: Oracle SQL Reference by Kreines & Jacobs, O´Reilly.

hth

Jan

"Adrien" <Adrien_at_nospam.com> schrieb im Newsbeitrag news:200324-171921-21996_at_foorum.com...
>
> Hello,
>
> This query works in SQL (it has no sense, it's just to show the subselect
> problem)
>
> select decode(sysdate, sysdate +1, sysdate, (select add_months(sysdate,1)
from
> dual)) from dual ;
>
> If I execute it in a PL/SQL function (Oracle 8i)
>
> dPosDate DATE;
> select decode(sysdate, sysdate +1, sysdate, (select add_months(sysdate,1)
from
> dual)) into dPosDate from dual ;
>
> I get an error (PLS-00103) and I can't compile : the subselect is not
recognized
> !
> Why ?!
>
> Thanks in advance.
> --
> Ce message a ete poste via la plateforme Web club-Internet.fr
> This message has been posted by the Web platform club-Internet.fr
>
> http://forums.club-internet.fr/
Received on Wed Feb 05 2003 - 01:27:48 CST

Original text of this message

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