Previous Topic

Next Topic

Using NULL Values in Expressions

Expressions can be used in the SELECT list for retrieving NULL values. If any value that participates in an arithmetic expression is NULL, the value of the entire expression is NULL.

Consider the following example:

EXEC SQL
 SELECT ename, sal, sal + commission
 FROM employee
 WHERE empno = 2452 ;

In the above example if the commission for empno 2452 is NULL, then the value of the expression sal + commission in the SELECT list would evaluate to NULL.