Informix Error -4117
-4117 A constant expression is expected here.
At least one of the values in one of the constant expressions in this CONSTANT statement cannot be evaluated at compile time. See the information on constant expressions in the IBM Informix 4GL Reference Manual for information on what types of operations can be used in constant expressions.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4117 fires when a value in a CONSTANT statement can't be evaluated at compile time — per the
official guidance, see the IBM Informix 4GL Reference Manual's coverage of constant
expressions for what operations are permitted.
- A
CONSTANTstatement's expression can't be evaluated at compile time, per the official guidance — the direct, only cause.
Solutions / Resolution
- Consult the IBM Informix 4GL Reference Manual's constant-expression rules, per the official guidance, and rewrite the expression using only permitted operations.
Examples
A non-constant expression in CONSTANT
CONSTANT max_id = getMaxId()
-- -4117: a function call cannot be evaluated at compile time
Corrected
CONSTANT max_id = 9999
Diagnostic Checks
- Check every value in a
CONSTANTstatement, and confirm it can be evaluated purely at compile time.
Related Errors / Related Topics
- -4118 — "Expressions of this data type are not allowed in constant expressions." A related constant-expression error, about the expression's data type being disallowed rather than it failing to evaluate at compile time.
A CONSTANT statement's value can't be evaluated at compile time — use only compile-time
constant operations.