Informix Error -24112: Cannot update column (%s).
Cause and resolution
Cannot update column (%s).
This error is generated when a user tries to update a column that is not from the target table. For example:
create table tab1 (col1 int, col2 int); create table tab2 (col3 int, col4 int); update tab1 set col4 = col3 + 1 from tab1, tab2 where col1 = col4;
This will generate the following error because the column col4 is not from the target table tab1:
24112: Cannot update column (col4). Error in line 1 Near character position 1
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-24112 fires when a multi-table UPDATE ... FROM statement's SET clause names a column
that doesn't belong to the target table — per the official guidance.
- A
SETclause assigning to a column from a joined table rather than the statement's actual target table, per the official guidance — the direct, only cause.
Solutions / Resolution
- Change the
SETclause to assign only to columns of the target table, per the official guidance.
Examples
Assigning to a joined table's column
CREATE TABLE tab1 (col1 INT, col2 INT);
CREATE TABLE tab2 (col3 INT, col4 INT);
UPDATE tab1 SET col4 = col3 + 1 FROM tab1, tab2 WHERE col1 = col4;
-- -24112: col4 belongs to tab2, not the target table tab1
Corrected
UPDATE tab1 SET col2 = col3 + 1 FROM tab1, tab2 WHERE col1 = col4;
Diagnostic Checks
- Check every column named in the
SETclause, and confirm each belongs to the statement's actual target table.
Related Errors / Related Topics
- -24300 — "Column (%s) not found in the target table." The same target-table-column
restriction, for
MERGE'sUPDATEclause rather than a multi-tableUPDATE. - -24301 — "Table (%s) is not the target table." A related
MERGE-statement target-table restriction. - -24302 — "Column (%s) not found in the source table." A related
MERGE-statement restriction, for theINSERTclause's source-table columns. - -24303 — "Table (%s) is not the source table." A related
MERGE-statement source-table restriction.
A multi-table UPDATE's SET clause assigned to a column from a joined table instead of
the target table — assign only to the target table's own columns.