Informix Error -4118: Expressions of this data type are not allowed in constant expressions.
Cause and resolution
Expressions of this data type are not allowed in constant expressions.
The indicated expression cannot be evaluated to a constant. Correct any other errors that might have been reported against this expression, and recompile.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4118 fires when a constant expression uses a data type that isn't allowed there — per the official guidance, this may also follow other, already-reported errors against the same expression.
- A constant expression using an unsupported data type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Correct any other errors that might have been reported against this expression, per the official guidance.
- Recompile, per the official guidance.
Examples
An unsupported type in a constant expression
CONSTANT default_photo = someByteValue
-- -4118: BYTE is not allowed in constant expressions
Corrected
CONSTANT max_photo_size = 65536
Diagnostic Checks
- Check the data type of every value in a constant expression, and confirm it's a supported type, fixing any earlier-reported errors first.
Related Errors / Related Topics
- -4117 — "A constant expression is expected here." A related constant-expression error, about the expression failing to evaluate at compile time at all, rather than using an unsupported data type.
A constant expression uses an unsupported data type — check its type and fix any earlier errors first.