Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please Help on Decode statement
Had you sifted carefully through the PL/SQL User's Guide you would have
discovered that DECODE may only appear in SQL/DML statements, as the error
message correctly portrayed.
e.g., SELECT decode(v_name,'one',1,'two',2,'0') INTO v_new_value FROM DUAL;
You should do the above in its own BEGIN..END block with an appropriate
exception handler, to catch problems inline.
-djc
Mujahid Hamid <mujahid_at_pharmco.demon.co.uk> wrote in article
<879286151.9034.0.nnrp-04.c2de4f17_at_news.demon.co.uk>...
> I am trying to use decode as following but it does not work; I trying to
> avoid using a complex 'if then else' statement by the use of decode:
> v_new_value:=decode(v_name,'one',1,'two',2,'0')
Received on Wed Nov 12 1997 - 00:00:00 CST
![]() |
![]() |