Informix Error -26081: Incorrect use of the CONNECT BY keywords in this context.
Cause and resolution
Incorrect use of the CONNECT BY keywords in this context.
The statement could not be run because CONNECT BY clause keywords were used incorrectly. Keywords that can only be used in the context of a CONNECT BY clause were used outside of a CONNECT BY clause. One of the following keywords was used outside of the context of a CONNECT BY clause: - the LEVEL, CONNECT_BY_ISLEAF, or CONNECT_BY_ISCYCLE pseudocolumn - the PRIOR or CONNECT_BY_ROOT unary operator - the SYS_CONNECT_BY_PATH() function - the ORDER SIBLINGS BY clause - the START WITH expression clause Make sure that you have provided CONNECT BY keywords in this context. Make sure that you have not used nested CONNECT BY clauses in the query.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-26081 fires when a CONNECT BY-specific keyword or construct is used outside a CONNECT BY clause — per the official guidance.
- The
LEVEL,CONNECT_BY_ISLEAF, orCONNECT_BY_ISCYCLEpseudocolumn used outside aCONNECT BYclause, per the official guidance — the first named case. - The
PRIORorCONNECT_BY_ROOTunary operator used outside aCONNECT BYclause, per the official guidance — the second named case. SYS_CONNECT_BY_PATH()used outside aCONNECT BYclause, per the official guidance — the third named case.ORDER SIBLINGS BYused outside aCONNECT BYclause, per the official guidance — the fourth named case.- A
START WITHexpression used outside aCONNECT BYclause, per the official guidance — the fifth named case. - Nested
CONNECT BYclauses in the same query, per the official guidance — also invalid.
Solutions / Resolution
- Only use these keywords/constructs within a
CONNECT BYclause's own query, per the official guidance. - Don't nest
CONNECT BYclauses, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond one of the listed keywords used
outside a CONNECT BY clause.
Diagnostic Checks
- Check the query for any of
LEVEL/CONNECT_BY_ISLEAF/CONNECT_BY_ISCYCLE/PRIOR/CONNECT_BY_ROOT/SYS_CONNECT_BY_PATH()/ORDER SIBLINGS BY/START WITHused outside aCONNECT BYclause, or nestedCONNECT BYclauses, and rewrite the query.
Related Errors / Related Topics
- -26079 — "CONNECT BY query resulted in a loop." A related
CONNECT BYerror, on a detected cycle in an otherwise-valid query rather than misused keywords.
A CONNECT BY-specific keyword was used outside a CONNECT BY clause, or CONNECT BY
clauses were nested — rewrite the query.