Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL problem
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