SIGN UP MEMBER LOGIN:
   
ARTICLE

NVL Function in Oracle/PLSQL

Posted by collin joe Articles | Oracle December 26, 2012
In this article I will describe the basic of NVL function in Oracle/PLSQL.
Reader Level:

The NVL function is used to replace NULL values by another value. Whenver a NULL value is encountered NVL replaces it by another value.

Syntax

NVL (expression 1, expression 2)

or

NVL ( string1, replace_with )

where string1 is the string which is tested for the NULL value and replace_with is the value which will be returned if the string is found to be NULL.

Example

select NVL(product_descr, product_name) from products;

In the above example if product_name is returned if the product_descr is found to be NULL else the value of product_descr is returned by the statement.

select NVL(salary, 0) from employees;
Here if the salary is found to be NULL then zero will be returned.

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