Informix Error -2978
-2978 The column column1 and the column column2 cannot be joined columns
because their types or lengths are different.The columns in a join must contain data from the same domain. The fact that these columns have different types or (if they are character columns) different lengths indicates that their contents are not from the same domain. Check the spelling of the column names to make sure that you named the correct columns. Review the design of the database, and make sure that these tables are meant to be joined on these columns.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2978 fires when two columns named in a join have different data types, or (for character columns) different lengths — per the official guidance, joined columns must contain data from the same domain, and a type or length mismatch indicates they aren't.
- A type mismatch between the two joined columns, per the official guidance — the first named cause.
- A length mismatch between two character-type joined columns, per the official guidance — the second named cause.
Solutions / Resolution
- Check the spelling of the column names to confirm the correct columns were named, per the official guidance.
- Review the database design to confirm these tables are meant to be joined on these columns, per the official guidance.
Examples
A join between mismatched types
ATTRIBUTES
order_id = orders.order_id, item.order_ref;
-- -2978: order_id is INTEGER, order_ref is CHAR(10)
Corrected
ATTRIBUTES
order_id = orders.order_id, item.order_id;
Diagnostic Checks
- Check the data type and length of both columns named in the join, and correct the column reference, or adjust the schema if the join was genuinely intended on mismatched columns.
Related Errors / Related Topics
- -2858 — "The table table-1 is joined to the table table-2, but its joined columns do not belong to a composite key." A related join-structure error, about a missing composite unique index rather than a type/length mismatch.
- -2977 — "Table table1 cannot be a master of table table2 because they do not join." A related join-validation error, about no join existing at all between two tables, rather than an existing join's columns mismatching in type or length.
Two joined columns have different types or lengths — check the column names and confirm the join was genuinely intended.