Informix Error -884
-884 Cannot alter an index on a temporary table.
Your program attempted to alter an index on a temporary table. Correct your program to avoid altering indexes on temporary tables.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-884 fires when ALTER INDEX targets an index on a temporary table — the same standing family
of temp-table restrictions as -508/-509/-510/-532/-548/-576/-781, here applied to index
alteration specifically.
ALTER INDEXattempted against an index defined on a temp table, per the official guidance — the direct, only cause.- DDL copy-pasted from a permanent-table index-maintenance script, applied to a temp table's index by mistake.
Solutions / Resolution
- Correct the program to avoid altering indexes on temporary tables, per the official guidance — the only path, consistent with the rest of this family of restrictions.
- Re-create the temp table (and its index) with the desired index characteristics from the
start, if a different index structure is actually needed:
DROP TABLE staging_orders; CREATE TEMP TABLE staging_orders (order_id INT, status CHAR(10)); CREATE INDEX idx_staging_status ON staging_orders (status);
Examples
The disallowed attempt
CREATE TEMP TABLE staging_orders (order_id INT, status CHAR(10));
CREATE INDEX idx_staging_status ON staging_orders (status);
ALTER INDEX idx_staging_status TO NOT CLUSTER;
-- -884: idx_staging_status is on a temporary table
Corrected — re-create with the desired structure
DROP TABLE staging_orders;
CREATE TEMP TABLE staging_orders (order_id INT, status CHAR(10));
CREATE INDEX idx_staging_status ON staging_orders (status);
Diagnostic Checks
- Confirm whether the index's underlying table is temporary before attempting
ALTER INDEX— if so, re-creating the table and index together is the only path.
Related Errors / Related Topics
- -508 through -510, -532, -548, -576, -781 — the standing family of temp-table restrictions this index-alteration restriction belongs to.
Part of the standing family of temp-table restrictions — re-create the temp table and its index together rather than trying to alter the index in place.