Informix Error -786
-786 Cannot attach to this table because it is not in the list of tables in the ATTACH clause.
The surviving table is either nonfragmented or hash-fragmented and must appear in the attach list in order for its existing fragment to be properly positioned in the resulting fragmentation scheme.Oninit® Troubleshooting Guidance
Reasons / Common Causes
-786 fires when the surviving (target) table of an ALTER FRAGMENT ... ATTACH is itself
nonfragmented or hash-fragmented, and its own existing data isn't included in the ATTACH
clause's table list — per the official guidance, in this specific case the surviving table's
existing fragment must be named in the attach list too, so the server knows where to position it
within the resulting fragmentation scheme.
- The target table is nonfragmented (a single storage location) or hash-fragmented, per the official guidance — for these two specific fragmentation states, the target's own existing data needs explicit positioning within the new scheme.
- The
ATTACHclause lists only the new table(s) being added, omitting the target table itself, per the official guidance — this omission is exactly what -786 flags for these specific starting states.
Solutions / Resolution
- Include the surviving table itself in the
ATTACHclause's table list, per the official guidance, alongside the new table(s) being attached:ALTER FRAGMENT ON TABLE orders ATTACH orders, orders_2025; - Confirm whether the target table is nonfragmented or hash-fragmented, since per the official guidance this requirement is specific to those two starting states — other fragmentation strategies (expression-based, range) may not need the target listed this way.
Examples
The disallowed attempt (target omitted)
-- orders is currently nonfragmented
ALTER FRAGMENT ON TABLE orders ATTACH orders_2025;
-- -786: orders itself must also appear in the ATTACH list
Corrected — include the target table too
ALTER FRAGMENT ON TABLE orders ATTACH orders, orders_2025;
Diagnostic Checks
- Check the target table's current fragmentation state (nonfragmented or hash-fragmented),
and if so, confirm it's included in the
ATTACHclause's own list.
Related Errors / Related Topics
- -782 — "Attached table is fragmented." A related
ATTACHrestriction, about the table being newly attached rather than the surviving target table's own listing requirement. - -783 — "Cannot attach because of incompatible schema." A related
ATTACHrestriction, on schema/LBAC compatibility rather than the attach list's composition.
Specific to a nonfragmented or hash-fragmented target — include the target table itself in the
ATTACH clause alongside the new table(s).