The data types of a result are determined by rules which are applied to the operands in an operation. This section explains those rules.
These rules apply to:
For the result data type of expressions that involve the operators /, *, + and -, see Expressions. For the result data type of expressions that involve the CONCAT operator, see With the concatenation operator.
The data type of the result is determined by the data type of the operands. The data types of the first two operands determine an intermediate result data type, this data type and the data type of the next operand determine a new intermediate result data type, and so on. The last intermediate result data type and the data type of the last operand determine the data type of the result. For each pair of data types, the result data type is determined by the sequential application of the rules summarized in the tables that follow.
If neither operand column allows nulls, the result does not allow nulls. Otherwise, the result allows nulls.
If the data type and attributes of any operand column are not the same as those of the result, the operand column values are converted to conform to the data type and attributes of the result. The conversion operation is exactly the same as if the values were assigned to the result. For example,
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.