PL/SQL NVL

Oracle PL/SQL NVL Function

The NVL function compares two expressions. If exp1 and exp2 are not equal then return exp1. If exp1 and exp2 are equal the function returns NULL.

The NVL Function syntax:

NVL( string, value )

value is returned if string is null.

Example 1:

Select NVL(e.bonus, 0) From employees e;

Example 2:

Select NVL(customer_email, 'n/a') From customers;