Informix Error -8111: User variables and run-time parameters may not be used in an ORDER BY statement.
Cause and resolution
User variables and run-time parameters may not be used in an ORDER BY statement.
Only names of columns can be used in an ORDER BY clause. Check the spelling of the column names or display labels in the clause. You cannot request ordering by the contents of defined variables, parameters, or ASCII fields.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-8111 fires when ORDER BY names a user variable, parameter, or ASCII field instead of a
column — per the official guidance, only column names (or display labels) can be used in
ORDER BY.
- A user variable, run-time parameter, or ASCII field used in
ORDER BY, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the spelling of the column names or display labels in the
ORDER BYclause, per the official guidance, and use only actual column names.
Examples
A parameter used in ORDER BY
ORDER BY sort_param
-- -8111: sort_param is a PARAM, not a column
Corrected
ORDER BY customer_id
Diagnostic Checks
- Check every name in
ORDER BY, and confirm it's a database column (or display label), not a defined variable, parameter, or ASCII field.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -8111 in this set yet.
ORDER BY names a variable/parameter/ASCII field instead of a column — use only column
names.