Informix Error -228: UPDATE or INSERT on ROWID prohibited.
Cause and resolution
UPDATE or INSERT on ROWID prohibited.
This statement names the column ROWID in the list of columns for insertion or update. The row ID is an intrinsic property that cannot be modified. You can select it in a SELECT statement and compare it in a WHERE clause, but you cannot modify its contents.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-228 is the DML-side sibling of -227: ROWID is an intrinsic, system-maintained property
that can be selected and compared, but never written to — not through DDL (-227), and not
through INSERT or UPDATE either.
ROWIDnamed in the column list of anINSERTstatement — attempting to explicitly provide a value for it.ROWIDnamed as a target column in anUPDATEstatement'sSETclause — attempting to change its value on an existing row.- Generic or auto-generated DML (an ORM, a data-migration script) iterating over "all
columns" including
ROWIDand attempting to include it in an insert or update, the same pattern -227 describes for DDL tooling. - Porting code from another system that has a different, writable notion of a similar pseudo-column.
Solutions / Resolution
- Don't include
ROWIDin anINSERTcolumn list or anUPDATESETclause. There's no workaround — it can't be written to under any circumstances. - For generic or auto-generated DML, exclude
ROWIDfrom column lists built by iterating over "all columns," the same fix as -227 for DDL tooling. - Continue using
ROWIDnormally inSELECTandWHEREclauses — only writing to it is restricted.
Examples
The disallowed operation
UPDATE customer SET ROWID = 999 WHERE customer_id = 1;
-- -228: ROWID can't be modified
INSERT INTO customer (ROWID, name) VALUES (999, 'Jane Doe');
-- -228: ROWID can't be explicitly assigned
Correct usage
SELECT ROWID, name FROM customer WHERE ROWID = 12345;
-- valid — reading and comparing ROWID is fine
Generic DML tooling mistakenly including ROWID
-- A data-migration script builds an INSERT from every column the
-- catalog reports for a table, including ROWID
columns = get_all_columns(table)
insert_sql = build_insert(table, columns)
-- fails with -228 if ROWID wasn't excluded
Diagnostic Checks
- Review the
INSERT/UPDATEstatement to confirmROWIDis the column being targeted. - Check generic or auto-generated DML logic for whether it's iterating over "all columns"
including
ROWIDwithout excluding it.
Related Errors / Related Topics
- -227 — "DDL operations on ROWID prohibited." The direct sibling — the same restriction, for schema changes instead of data changes.
- -205 — "The statement failed because you cannot use ROWID for views with union,
intersect, minus, aggregates, group by, multiple tables, or derived tables." Another
ROWIDrestriction in the same general family.
Exclude ROWID from any generic "apply this to every column" logic in DML, exactly as with DDL
under -227 — it's read-only, always.