Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: case when ... then expression
Nicolas MUGNIER wrote:
> Hi,
>
> How can I use the CASE WHEN ... THEN expression in a PL/SQL block ?
>
> I'v the following statement:
> INSERT INTO table(id, word) VALUES (ID, CASE WHEN x>1 THEN 'Word1' WHEN x>2
> THEN 'Word2' ELSE 'Word3' END);
>
> This statement works on command line but it doesn't in a PL/SQL block or in
> a stored procedure.
> Can somebody help me ?
>
> Thanks
>
> nunch
You can't.
You can, however, use DECODE which is Oracle's version of that syntax. It is far less verbose and performs the same function.
Daniel A. Morgan Received on Mon Jun 25 2001 - 14:08:48 CDT
![]() |
![]() |