Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

NVL function (extension)


NVL ( expression, expression )


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.


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

FROM employee ;


  • 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.