Home » SQL & PL/SQL » SQL & PL/SQL » Not Null then Pass Value (Form 6i, Oracle 9i)
Not Null then Pass Value [message #397493] Sat, 11 April 2009 08:32 Go to next message
cvs_1984
Messages: 136
Registered: August 2007
Location: Punjab, INDIA
Senior Member

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 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
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 #397497 is a reply to message #397493] Sat, 11 April 2009 09:45 Go to previous messageGo to next message
BlackSwan
Messages: 25035
Registered: January 2009
Location: SoCal
Senior Member
> (Form 6i, Oracle 9i)
Both are obsoleted & unsupported.
Suggest you upgrade to supported versions.
Re: Not Null then Pass Value [message #397500 is a reply to message #397497] Sat, 11 April 2009 10:01 Go to previous message
pablolee
Messages: 2834
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.
Previous Topic: query to give all months
Next Topic: invalid data inserted
Goto Forum:
  


Current Time: Sat Dec 03 14:20:29 CST 2016

Total time taken to generate the page: 0.12578 seconds