Informix Error -772
-772 Record/key doesn't qualify for any table/index fragment.
This error can occur during a record insert or update. The most likely cause is an incorrect fragmentation specification that did not specify a REMAINDER. The easiest correction is to add a REMAINDER fragment to your SQL statement. However, the best correction is probably to reexamine the original fragmentation specification, figure out what is wrong, and fix it with an ALTER FRAGMENT statement.
For interval fragmented table or index, ensure that automatic interval fragment creation is enabled. The following query can be used to determine if automatic interval fragment creation is enabled for a table and its indexes:
SELECT t.tabname, f.indexname, decode(bitand(f.flags, 2048), 0, 1, 0) intvl_enabled FROM sysfragments f, systables t WHERE f.tabid = t.tabid AND f.evalpos = -2 AND t.tabname = <tabname>; </tabname>
The following are examples on how to enable automatic interval fragment creation for an interval fragmented table or index:
ALTER FRAGMENT ON TABLE <tabname> MODIFY INTERVAL ENABLED; ALTER FRAGMENT ON INDEX <idxname> MODIFY INTERVAL ENABLED; </idxname></tabname>
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-772 fires during INSERT/UPDATE on a fragmented table when the row's values don't match any
fragment's expression — per the official guidance, the most likely cause is a fragmentation
specification missing a REMAINDER fragment to catch values that don't fit any explicit
expression.
- An expression-based fragmentation scheme with no
REMAINDERfragment, per the official guidance — the most likely, named cause; any row whose values fall outside every explicit fragment expression has nowhere to go. - A fragmentation specification with a genuine logic error, per the official guidance's deeper suggested fix — the expressions themselves may have gaps or contradictions beyond just missing a catch-all.
- For an interval-fragmented table/index, automatic interval fragment creation not enabled, per the official guidance — new fragments that should be created automatically for out-of-range values aren't being created.
Solutions / Resolution
- Add a
REMAINDERfragment, per the official guidance's easiest fix:ALTER FRAGMENT ON TABLE orders ADD REMAINDER remainder_dbspace; - Or, better, re-examine the original fragmentation specification and fix the underlying
gap with
ALTER FRAGMENT, per the official guidance's preferred, more thorough fix — aREMAINDERfragment treats the symptom; understanding why the row didn't match any expression addresses the cause. - For an interval-fragmented table/index, confirm automatic interval fragment creation is enabled, per the official guidance, if that's the fragmentation strategy in use.
Examples
Adding a REMAINDER fragment as a quick fix
ALTER FRAGMENT ON TABLE orders ADD REMAINDER remainder_dbspace;
Reviewing the fragmentation scheme to find the gap
SELECT partn, evaltext FROM sysfragments WHERE tabid =
(SELECT tabid FROM systables WHERE tabname = 'orders') AND fragtype = 'T';
-- review each fragment's expression (evaltext) for gaps in the coverage
Diagnostic Checks
- Check whether the table's fragmentation scheme includes a
REMAINDERfragment. - For interval fragmentation, check whether automatic interval fragment creation is enabled.
- Review the specific row's values against each fragment's expression to understand exactly why none of them matched.
Related Errors / Related Topics
- -773 — "Expression required for new fragment." A related
ALTER FRAGMENTerror, about adding a new expression-based fragment without supplying its expression. - -774 — "Cannot specify fragment expressions with a round-robin fragmentation." A related
ALTER FRAGMENTrestriction, about supplying an expression where the fragmentation strategy doesn't use one.
A REMAINDER fragment is the quick fix; understanding why the row fell outside every fragment
expression is the thorough one.