Table of ContentsPreviousNext

Ispirer
Please, note, that Ispirer SQLWays 6.0 is no longer supported and provided to clients.
You can try out automated conversion of databases and applications with Ispirer Toolkit for free. Download free trial.
Check out the relevant toolkit documentation.
Ispirer Database Conversion overview.


Ispirer SQLWays Database Migration Software

Returning one of expressions depending on whether check expression is NULL or NOT NULL

This chapter describes functions used in various databases to return one of two expressions depending on whether a specified check expression is NULL or NOT NULL, and their conversion by SQLWays.

Note. These functions differ from functions like ISNULL, COALESCE etc. that return the first non-null value.

TABLE 68. Returning one of expressions depending on whether check expression is NULL or NOT NULL
Database
Syntax
Description
Oracle
NVL2 (exp1, exp2, exp3)
NVL2 lets you determine the returned value depending on whether a specified expression is NULL or NOT NULL.
 
If exp1 is NULL value, then the value of exp2 is returned. If exp1 is not NULL, the value of exp3 is returned. The argument exp1 can have any data type.
 
If the data types of exp2 and exp3 are different, then Oracle converts exp3 to the data type of exp2 before comparing them unless exp3 is a NULL constant
 
The data type of the return value is always the same as the data type of exp2, unless exp2 is character data, in this case the returned value's data type is VARCHAR2.
Sybase Adaptive Server Anywhere
IFNULL (exp1, exp2 [,exp3])
IFNULL lets you determine the returned value depending on whether a specified expression is NULL or NOT NULL.
 
If exp1 is NULL value, then the value of exp2 is returned. If exp1 is not NULL, the value of exp3 is returned. If exp1 is not NULL and there is no exp3, NULL is returned.
Microsoft SQL Server
-
Not supported.


Table of ContentsPreviousNext
Copyright 1999-2023 Ispirer Systems.
Ispirer and SQLWays are registered trademarks. All other product names may be trademarks of the respective companies.
All rights reserved.