RE: If else in decode

RE: If else in decode

 

  

You don't need to user IF ELSE clause inside decode, since decode itself
is a replacement for IF ELSE.

Assume you need to do something like this

IF X = 1 THEN
Y := X;
ELSE
Y := Z;
END IF;

Instead of writing IF ELSE you can write

SELECT decode(X, 1, X, Z) INTO Y FROM tablename;

Thus decode replaces your IF ELSE clause.

Mohan.

-----Original Message-----
From: Navin
[mailto:oracledba-ezmlmshield-x63462087.[Email address protected]
Sent: Friday, December 03, 2004 4:11 AM
To: LazyDBA Discussion
Subject: If else in decode

Hi Gurus,
Can anyone tell me how to use if else clause in decode statement, Urgent
help is highly appreciated

Thanks & Regards,
Navin Gupta


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html


Oracle LazyDBA home page