skip to main content
Functions : Scalar functions : IFNULL, ISNULL, NVL
 

IFNULL, ISNULL, NVL

These functions allow NULL value to be replaced by a default value. OpenAccess SDK supports IFNULL as defined by ODBC, ISNULL as defined by Microsoft SQL Server, and NVL as defined by Oracle.

Syntax 

IFNULL (expr, default_val)
ISNULL (expr, default_val)
NVL (expr, default_val)

Description

The OpenAccess SDK SQL engine evaluates the input expression and returns the expression value if it is non-NULL. If the expression value is NULL, default_val is returned. The return value is of the same data type as the input expression.

Example 

SELECT ename, IFNULL (sal, 1000) FROM emp;
SELECT ename, ISNULL (sal, 1000) FROM emp;
SELECT ename, NVL (sal, 1000) FROM emp;
 
SELECT ename, IFNULL (hiredate, '2001-01-01') FROM emp;