Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

NVL function (extension)

Syntax

NVL ( expression, expression )

Description

The scalar function NVL returns the value of the first expression if the first expression value is not null. If the first expression value is null, the value of the second expression is returned.

The NVL function is not ODBC compatible. Use the IFNULL function for ODBC-compatible syntax.

Example

SELECT salary + NVL (comm, 0) 'TOTAL SALARY'

FROM employee ;

Notes

  • The first argument to the function can be of any type except for LONG data types.
  • The type of the second argument must be compatible with that of the first argument.
  • The type of the result is the same as the first argument.

TOCIndex