SIGN UP MEMBER LOGIN:
   
ARTICLE

NVL() Function in Oracle SQL Plus

Posted by Jerry Gale Articles | Oracle March 10, 2011
NVL() Function returns a specified string on the place of NULL in a column.
Reader Level:

NVL() Function

The NVL() Function is used to replace the NULL(returned as blank) in a column with a string value in the result of a query. It takes two expressions in argument, these expressions may be of any type, Oracle Database will implicitly converts the types of expressions, But if conversion is not applicable, then returns an error.

Syntax:
NVL(expression1, expression2)

Example:
We have a table Persons :
 NVL1.gif
Now, we want to write 'NA' on the place of NULL in MName, we'll use following query :

SELECT NVL(MName, 'NA') FROM Persons;

The result-set will look like :
 NVL2.gif

Login to add your contents and source code to this article
This Feature is Sponsored By
post comment
COMMENT USING