Oracle database
SELECT NVL( col1,
col2)
FROM t1;
* col1 is assumed to be VARCHAR(100) type, and col2 is assumed to be CHAR(100) type
Symfoware Server
SELECT NVL( col1,
CAST(col2 AS VARCHAR(100)))
FROM t1;
* col1 is assumed to be VARCHAR(100) type, and col2 is assumed to be CHAR(100) type
Value expressions with different data types can be specified. If the first argument is a string value, then VARCHAR2 is returned, and if it is a numeric, then a numeric type with greater range is returned.
Value expressions with different data types cannot be specified.
Since the data types that can be specified for expressions 1 and 2 are unknown, use the following steps to convert:
Check the data types specified for the expressions 1 and 2.
Using the data type that is to be received as a result, explicitly convert the other argument with CAST.