Informix Error -871
-871 Remainder fragment must be specified last.
If you specify a REMAINDER, it must be the last fragment expression. Rewrite your syntax so that you specify the remainder fragment last.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-871 fires when a REMAINDER fragment appears anywhere other than the last position in a
fragmentation specification — per the official guidance, it must always be listed last.
REMAINDERlisted before one or more expression-based fragments, per the official guidance — the direct, only cause.
Solutions / Resolution
- Rewrite the fragmentation specification so
REMAINDERis listed last, per the official guidance.
Examples
The disallowed order
CREATE TABLE orders (order_id INT, region CHAR(10))
FRAGMENT BY EXPRESSION
REMAINDER IN dbspace2,
(region = 'east') IN dbspace1;
-- -871: REMAINDER must come last
Corrected
CREATE TABLE orders (order_id INT, region CHAR(10))
FRAGMENT BY EXPRESSION
(region = 'east') IN dbspace1,
REMAINDER IN dbspace2;
Diagnostic Checks
- Check the position of
REMAINDERin the fragmentation specification, moving it to the end if it appears earlier.
Related Errors / Related Topics
- -870 — "Cannot specify duplicate remainder fragments." A related
REMAINDER-clause restriction, about duplication rather than ordering. - -772 — "Record/key doesn't qualify for any table/index fragment." A related fragmentation
error, about a missing
REMAINDERfragment rather than one out of order.
A simple ordering requirement — REMAINDER must always be the last fragment listed.