Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DECODE question 1

Status
Not open for further replies.

pmbtech

Programmer
Nov 24, 2003
47
US
if i have a decode statement such as:
DECODE(function call 1, 'Y', function call 2)
Will function call 2 always be made or only when function call 1 = 'Y' ?
 
Yes...and if the result of "function call 1" is not 'Y', then the DECODE result is NULL, since you did not include a final, "no match" argument in the DECODE to specify what result you want if none of the previous explicit-compare values match the result of "function call 1".

Does this answer your question, or have you follow-on questions?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Thanks, that is what I thought, but wasn't sure. I am a convert from MS SQL and still learning the in's and out's of Oracle. I've inherited a huge view with a dozen function calls and have to figure out how to make it run faster, so I am just trying to understand what is happening now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top