Using the NVL Function

Sunday, January 31, 2010 ·

The Null Value

An empty field is said to contain NULL. A NULL is defined as a value that is unavailable, unassigned, unknown, or inapplicable. A NULL is not the same as a zero or a space. Zero is a number, and a space is a character. The COMMISSION_PCT column in the EMPLOYEES table contains NULLs.

Columns of any data type can contain NULLs unless the column was defined as NOT NULL when the table was created. Also, primary key columns cannot have NULLs.
NVL Function

You can use the NVL function to convert a NULL to another value.

NVL Syntax

NVL ( expr1, expr2)

* expr1 is the source value or expression.
* expr2 is the target or resulting value to substitute.

0 comments: