Informix Error -2860: There is a column/value type mismatch for column-name.
Cause and resolution
There is a column/value type mismatch for column-name.
This statement assigns a value to the field with the DEFAULT clause or uses its value with the INCLUDE clause, but it does so with data that does not agree with the data type of the field. Review the data type of the field (which comes from the column with which it is associated), and make sure that only compatible values are assigned.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2860 fires when a DEFAULT clause or INCLUDE clause assigns a value to a field that doesn't
agree with the data type of the underlying column — per the official guidance, this happens
because the field's data type comes from the column it's associated with, and the assigned
value doesn't match.
- A
DEFAULTorINCLUDEclause assigning a value whose type doesn't match the field's associated column, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the data type of the field (which comes from the column it's associated with), per the official guidance.
- Make sure only compatible values are assigned to it, per the official guidance.
Examples
A type mismatch on DEFAULT
ATTRIBUTES
order_date = order_date, DEFAULT = "pending";
-- -2860: order_date is DATE, "pending" is not a valid date literal
Corrected
ATTRIBUTES
order_date = order_date, DEFAULT = TODAY;
Diagnostic Checks
- Check the column's actual data type against the value supplied in the
DEFAULTorINCLUDEclause, and correct whichever one is wrong.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -2860 in this set yet.
A DEFAULT/INCLUDE value doesn't match its field's associated column type — review both and
align them.