Home » SQL & PL/SQL » SQL & PL/SQL » NVL Function
NVL Function [message #646620] Tue, 05 January 2016 13:09 Go to next message
johnsid
Messages: 3
Registered: January 2016
Location: India
Junior Member
What is the use of NVL function?
Re: NVL Function [message #646622 is a reply to message #646620] Tue, 05 January 2016 13:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
johnsid wrote on Tue, 05 January 2016 11:09
What is the use of NVL function?


unwilling or incapable to Read The Fine Manual yourself?

http://docs.oracle.com/database/121/SQLRF/functions131.htm#SQLRF00684
Re: NVL Function [message #646649 is a reply to message #646622] Wed, 06 January 2016 06:09 Go to previous messageGo to next message
garan
Messages: 27
Registered: January 2016
Junior Member
Hi

simply NVL function is used to display alternate string value/DATE when the value obtained is null

SQL> select nvl('',sysdate) from dual;

NVL('',SYSDATE)
------------------
06-JAN-16

SQL> SELECT NVL(NULL,SYSDATE) FROM DUAL;

NVL(NULL,
---------
06-JAN-16

SQL> SELECT NVL('ABC',SYSDATE) FROM DUAL;

NVL('ABC',SYSDATE)
------------------
ABC

garani
Re: NVL Function [message #646652 is a reply to message #646649] Wed, 06 January 2016 07:23 Go to previous message
javon13
Messages: 17
Registered: October 2015
Junior Member
Operations with NULL can be quite tricky. So it is sometimes useful to translate NULL to some other value and NVL function is good for that.
Previous Topic: Query is not running from 11.2.0.3 to 11.2.0.4
Next Topic: repeat the previous value to next rows
Goto Forum:
  


Current Time: Fri Apr 26 08:58:07 CDT 2024