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 does not recognize CASE WHEN ELSE END construct as a valid expression

Re: PL/SQL does not recognize CASE WHEN ELSE END construct as a valid expression

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 30 Jul 2002 23:36:25 GMT
Message-ID: <3D4722F9.2F99311@exesolutions.com>


FC wrote:

> Hello,
> did anybody come across the following on Win2K Ora 8.1.7.0.0 EE?
>
> While I am allowed to use the CASE WHEN ELSE END construct within ordinary
> SQL, I cannot use it within PL/SQL modules (syntax error occurs). On the
> other hand I can use the DECODE function, although it's harder to code in
> certain cases.
> I couldn't find any document stating that PL/SQL does not support this
> feature.
>
> Bye...
> Flavio

This has been repeatedly dealt with here in the c.d.o. usenet groups over the last three or four months. Until 9i CASE was handled in the SQL engine and not in the PL/SQL engine. So in 8i it works in SQL*Plus and in native dynamic SQL. In 9i it works everywhere. So if you need it in a stored procedure just wrap it in NDS.

Daniel Morgan Received on Tue Jul 30 2002 - 18:36:25 CDT

Original text of this message

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