Informix Error -882
-882 Cannot create rowids on a non-fragmented table.
You tried to use the ALTER TABLE... ADD syntax to add a rowid column to a table that is not fragmented. This usage is not valid. If a rowid column already exists, rowids already exist on non-fragmented tables.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-882 fires when ALTER TABLE ... ADD ROWIDS targets a non-fragmented table — per the official
guidance, this isn't valid because non-fragmented tables already have ROWID by default; there's
nothing to add.
ALTER TABLE ... ADDa ROWID column attempted on a non-fragmented table, per the official guidance — the direct, only cause; per the official guidance's own closing note, ROWID already exists on non-fragmented tables automatically.- A misunderstanding of when
ADD ROWIDSis needed at all — this operation is specific to fragmented tables, which (unlike non-fragmented ones) don't automatically carry ROWID.
Solutions / Resolution
- Don't attempt
ADD ROWIDSon a non-fragmented table — per the official guidance, it already has one; the statement is unnecessary, not just disallowed. - Confirm the table's fragmentation status before attempting to add ROWID, via
sysfragments(fragtype = 'T'rows describe table fragmentation, as opposed to'I'for index fragmentation) — a table with no matching row here is non-fragmented:SELECT strategy, partition FROM sysfragments WHERE fragtype = 'T' AND tabid = (SELECT tabid FROM systables WHERE tabname = 'orders'); - If ROWID is genuinely needed on a fragmented table,
ADD ROWIDSis the correct operation there — this restriction is specific to non-fragmented tables, which don't need it.
Examples
The disallowed attempt
-- orders is non-fragmented, and therefore already has ROWID
ALTER TABLE orders ADD ROWIDS;
-- -882: unnecessary and disallowed on a non-fragmented table
Diagnostic Checks
- Confirm whether the table is fragmented, via
sysfragments(fragtype = 'T'), before attemptingADD ROWIDS— non-fragmented tables already have it automatically.
Related Errors / Related Topics
- -855 — "Cannot drop rowids on a non-fragmented table." The mirror-image restriction: ROWID can't be dropped from a non-fragmented table either, since it's intrinsic there.
- -856 — "Rowids already exist on table." A related ROWID-management error, about redundantly adding ROWID to a table (fragmented or not) that already has one.
Non-fragmented tables already have ROWID automatically — ADD ROWIDS is unnecessary and
disallowed there; it's meant for fragmented tables specifically.