|Oracle8i SQL Reference
Release 2 (8.1.6)
Functions, 67 of 121
If expr1 is not null,
NVL2 returns expr2. If expr1 is null,
NVL2 returns expr3. The argument expr1 can have any datatype. The arguments expr2 and expr3 can have any datatypes except
If the datatypes of expr2 and expr3 are different, Oracle converts expr3 to the datatype of expr2 before comparing them unless expr3 is a null constant. In that case, a datatype conversion is not necessary.
The datatype of the return value is always the same as the datatype of expr2, unless expr2 is character data, in which case the return value's datatype is
The following example shows whether the income of each employee in department 30 is made up of salary plus commission, or just salary, depending on whether the
COMM column of
EMP is null or not.