Informix Error -415
-415 Data conversion error.
The database server is unable to convert between a program variable and a database column. It performs automatic data conversion in many cases but could not in this case. For instance, a character string will be converted to a numeric type so long as the string contains the digits of a valid number, or a float or decimal number will be converted to integer so long as the receiver has enough precision for the value. Review this statement, and inspect each program variable that does not have the same data type as the matching database column.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-415 fires when the server's usual automatic conversion between a program (host) variable and a database column fails for a specific value — the types are compatible in general, but this particular value doesn't convert cleanly.
- A character string containing non-numeric characters being converted to a numeric column — automatic conversion only works if the string's content is genuinely valid digits (with optional sign/decimal point).
- A floating-point or decimal value with more precision than an integer column can hold, attempted to convert to that integer type — the conversion is only valid when the value's precision actually fits.
- A value out of range for the target type even when the general type category matches (e.g. a number too large for the target column's numeric type).
- Locale/formatting mismatches — a string formatted with unexpected separators or a different decimal convention than the server expects.
Solutions / Resolution
- Review the statement and inspect each program variable for a data type mismatch against its corresponding database column, per the official guidance.
- Validate string content before relying on automatic numeric conversion — confirm it contains only valid digits (and optional sign/decimal point) for the target type.
- Check whether a floating-point/decimal value's actual precision fits the target integer column before conversion, rounding or truncating explicitly if that's the intended behavior.
- Check for locale/formatting mismatches in string representations of numbers or dates.
Examples
A non-numeric string failing conversion
INSERT INTO orders (order_id, quantity) VALUES (1001, 'five');
-- -415: 'five' isn't a valid numeric string
Fix — supply a genuinely numeric value:
INSERT INTO orders (order_id, quantity) VALUES (1001, 5);
A decimal value with too much precision for an integer column
INSERT INTO orders (order_id, quantity) VALUES (1001, 5.75);
-- -415 if quantity is INTEGER and 5.75 can't be represented
-- without loss the server won't silently truncate
Fix — round or truncate explicitly if that's genuinely intended:
INSERT INTO orders (order_id, quantity) VALUES (1001, 6);
Diagnostic Checks
- Identify which program variable/column pair triggered the failure.
- Check the actual runtime value (not just its declared type) against the target column's type and precision requirements.
- Check for locale/formatting differences if the value is a string representation of a number or date.
Related Errors / Related Topics
- -367 — "Sums and averages cannot be computed for character columns." A related type-mismatch error, though specific to aggregate functions rather than general value conversion.
- -391 — "Cannot insert a null into column column-name." Another value-level insert/update failure, about nullability rather than type conversion.
Check the actual runtime value, not just its declared type — automatic conversion works for most values of a compatible type, but a specific value's content or precision can still make it fail.