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 -> Please Help on Decode statement

Please Help on Decode statement

From: Mujahid Hamid <mujahid_at_pharmco.demon.co.uk>
Date: 1997/11/11
Message-ID: <879286151.9034.0.nnrp-04.c2de4f17@news.demon.co.uk>#1/1

I am a new PL/Sql Programmer (Oracle 7.3)

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')

the error message I get is : you must use decode within sql.

If I use decode with a select then it works eg:

select decode(v_name,'one'1,'two,2) from table

help me please

Cheers. Received on Tue Nov 11 1997 - 00:00:00 CST

Original text of this message

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