Not Null then Pass Value [message #397493] |
Sat, 11 April 2009 08:32 |
|
Hi,
I required to pass the Value for the variable if the another
variable is Not null.
Ex:
U1 Number(2);
U2 Number(2);
C1 Char(1);
If U1 and U2 is Not Null Then C1 is set has comma and set between the U1 and U2.
U1 := 2;
U2 := 4;
Output Required is (2,4);
This output is used in Select Statement.
What command is Used for get this output.
Thanks,
C V S
[Updated on: Sat, 11 April 2009 09:41] by Moderator Report message to a moderator
|
|
|
Re: Not Null then Pass Value [message #397495 is a reply to message #397493] |
Sat, 11 April 2009 09:41 |
|
Michel Cadot
Messages: 68624 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Quote: | I required to pass the Value for the variable if the another variable is Not null.
|
Generally speaking, NVL2
Quote: | If U1 and U2 is Not Null Then C1 is set has comma and set between the U1 and U2.
U1 := 2;
U2 := 4;
Output Required is (2,4);
This output is used in Select Statement.
|
And if not?
Output to what? From what?
I don't understand the rest of the post. Post some examples.
Regards
Michel
[Updated on: Sat, 11 April 2009 09:42] Report message to a moderator
|
|
|
|
Re: Not Null then Pass Value [message #397500 is a reply to message #397497] |
Sat, 11 April 2009 10:01 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
BlackSwan wrote on Sat, 11 April 2009 15:45 | > (Form 6i, Oracle 9i)
Both are obsoleted & unsupported.
Suggest you upgrade to supported versions.
|
I recently (OK about 18months-ago-recent-ish) did some work for a company which had a v7 database. They had an horrendously obsoleted version because the third party software that was currently essential to the operation of their business was not compatible with later releases and they simply didn't have the funding to upgrade that software, (not that they needed to, it worked very well and did exactly what it was meant to) It is not always possible to live in this idealistic world of yours where everyone has the latest kit and the latest release.
@OP as Michel said, you can look into NVL2 and you can combine this with a simple CASE expression.
|
|
|