Informix Error -1279: Value exceeds string column length.
Cause and resolution
Value exceeds string column length.
This message applies only to ANSI databases. You attempted to insert into a CHAR, NCHAR, VARCHAR, NVARCHAR or LVARCHAR column using a string host variable, but the string is too long.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1279 fires on ANSI databases when a string inserted via a host variable exceeds the target
CHAR/NCHAR/VARCHAR/NVARCHAR/LVARCHAR column's maximum length — per the official
guidance, this check is specific to ANSI-mode databases.
- A host variable's string value longer than the target column's declared length, per the official guidance — the direct, only cause.
Solutions / Resolution
- Truncate or shorten the value to fit the column's declared length, if truncation is acceptable.
- Widen the target column's declared length, if the longer value needs to be preserved in full.
Examples
A host variable's value exceeding the column's length
/* status is CHAR(10) */
char v_status[100] = "a_much_longer_status_value";
EXEC SQL INSERT INTO orders (order_id, status) VALUES (:v_order_id, :v_status);
/* -1279: v_status's value exceeds status's 10-character length (ANSI database) */
Corrected — widen the column
ALTER TABLE orders MODIFY (status CHAR(30));
Diagnostic Checks
- Compare the host variable's actual string length against the target column's declared length.
Related Errors / Related Topics
- -1278 — "Invalid escape sequence." A related ANSI-database error, about pattern-matching escape characters rather than column length.
The value exceeds the target string column's length on an ANSI database — truncate the value or widen the column.