Informix Error -4157: The statement is too complex. Try to simplify it.
Cause and resolution
The statement is too complex. Try to simplify it.
This error occurs if a stack overflow is detected during compilation. Under Windows, the stack size is limited. Try to reduce the complexity of your code. Complex expressions, such as many string concatenations ('||'), can consume a large portion of the stack.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4157 fires when the compiler detects a stack overflow during compilation — per the official
guidance, this is especially likely under Windows, where the compiler's stack size is limited;
complex expressions such as many string concatenations (||) can consume a large portion of
it.
- A statement too complex for the compiler's available stack space, per the official guidance — the direct, only cause; string concatenation chains are a named example.
Solutions / Resolution
- Reduce the complexity of the code, per the official guidance, for example by breaking a
long chain of
||concatenations into intermediate steps.
Examples
A deeply chained concatenation
LET msg = a || b || c || d || e || f || g || h || i || j || k || l
Corrected
LET part1 = a || b || c || d
LET part2 = e || f || g || h
LET msg = part1 || part2 || i || j || k || l
Diagnostic Checks
- Check the flagged statement for deeply nested or chained expressions, and break it into intermediate steps.
Related Errors / Related Topics
- -4122 — "Parser limitations have been exceeded. Try to reduce complexity or size of module." A related complexity limit, about the parser's stack rather than the compiler's general expression-evaluation stack.
A single statement is too complex for the compiler's stack — break it into intermediate steps.