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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Please Help on Decode statement

Re: Please Help on Decode statement

From: Dan Clamage <clamage_at_mime.dw.lucent.com>
Date: 1997/11/12
Message-ID: <01bcef6d$548a1320$54110b87@clamagent>#1/1

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

Original text of this message

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