Informix Error -519: Cannot update column to illegal value.
Cause and resolution
Cannot update column to illegal value.
One of the values in this UPDATE statement is based on an expression that is in error. Check each expression in the SET clause for validity. Look in particular at uses of built-in functions such as LENGTH and DATE.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-519 fires when an expression in an UPDATE ... SET clause itself evaluates to an error — the
column being updated isn't the problem; the expression computing its new value is.
- A built-in function called with invalid arguments within the SET clause — per the official
guidance's explicit examples,
LENGTHandDATEare common culprits (e.g.DATE()given a string that isn't a valid date format). - An arithmetic expression that overflows or divides by zero as part of computing the new column value.
- A type-conversion expression given a value it can't actually convert (a string that isn't numeric passed where a numeric conversion is expected).
Solutions / Resolution
- Check each expression in the SET clause for validity, per the official guidance, working through them one at a time rather than assuming the failure is in the column itself.
- Look in particular at built-in function calls such as
LENGTHandDATE, per the official guidance, checking that the arguments passed are of a type/format the function actually accepts. - Isolate the failing expression by testing it in a standalone
SELECTbefore including it in theUPDATE, since aSELECTwill surface the same evaluation error more cheaply.
Examples
An invalid DATE() argument
UPDATE orders SET ship_date = DATE('not-a-date') WHERE order_id = 42;
-- -519: DATE() can't parse 'not-a-date'
Isolating the failing expression first
SELECT DATE('not-a-date') FROM systables WHERE tabid = 1;
-- reproduces the same evaluation error, without touching any table's data
Diagnostic Checks
- Test each SET-clause expression independently via a standalone
SELECTto find which one is actually failing before assuming the issue is elsewhere in the statement. - Review the argument types/formats expected by any built-in function used, especially
LENGTH/DATE, against what's actually being passed.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -519 in this set yet.
The failure is in evaluating an expression in the SET clause, not the target column — isolate the expression with a standalone SELECT to find it quickly.