Informix Error -1260: It is not possible to convert between the specified types.
Cause and resolution
It is not possible to convert between the specified types.
The database server attempts any data conversion that makes sense. Some conversions, however, are not supported, such as INTERVAL to DATE, DATETIME to MONEY, CHAR to LIST, or CHAR to SET. Possibly you referenced the wrong variable or column. Check that you have specified the data types that you intended and that literal representations of data values are correctly formatted.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1260 fires when a statement attempts a conversion between two types the database server simply
doesn't support — per the official guidance, named examples include INTERVAL to DATE,
DATETIME to MONEY, CHAR to LIST, and CHAR to SET.
- A conversion between two fundamentally incompatible types, per the official guidance's named examples — the direct, common cause.
- A literal data value not formatted correctly for its intended type, per the official guidance's other suggested check, making the server unable to determine a valid conversion path.
Solutions / Resolution
- Verify that the correct data types were specified, per the official guidance.
- Verify that literal data values are properly formatted, per the official guidance, for the type actually intended.
Examples
An unsupported conversion
SELECT CAST(order_datetime AS MONEY) FROM orders WHERE order_id = 1;
-- -1260: DATETIME to MONEY has no supported conversion
Diagnostic Checks
- Check the source and target types involved against the database server's documented supported-conversions list.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1260 in this set yet.
The conversion attempted (e.g. DATETIME to MONEY, CHAR to LIST/SET) isn't supported —
verify the intended types and literal formatting.