-8028: UNION columns must be compatible
Explanation:
In a <QUERY EXPRESSION> with at least a UNION, INTERSECT or EXCEPT specification, all sequences of SELECT COLUMNS must designate the same number of columns. The data types of the corresponding columns must thereby comply with the conditions valid for comparability.
Each data type can be compared to itself. Columns of data type CHAR with the different code attributes ASCII and EBCDIC can be compared to each other; they are implicitly adapted. Columns with the code attribute ASCII and EBCDIC can be compared to date, time, and timestamp specifications.
All numbers can be compared to each other.
In SQLMODE ANSI, it is not sufficient that the data types and lengths of the specified columns are compatible; they must be equal. Moreover, only <COLUMN SPEC> or * may be specified in the SELECT COLUMNs of the QUERY specs connected by UNION. The specification of LITERALs is not allowed.
User Action:
Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the current definition of the affected columns. It may be attempted to achieve comparability by applying a <CONVERSION function>.
This request cannot be made in SQLMODE ANSI.