Informix Error -4352
-4352 The program cannot continue a FOREACH loop at this time because
it is not within a FOREACH loop.A CONTINUE FOREACH statement is not between a FOREACH statement and its matching END FOREACH statement. Perhaps the FOREACH statement has been accidentally deleted, or perhaps you changed to another type of loop such as WHILE or FOR.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4352 fires when CONTINUE FOREACH doesn't fall between a FOREACH statement and its
matching END FOREACH — per the official guidance, the FOREACH statement may have been
accidentally deleted, or the loop type may have been changed to WHILE/FOR without updating
the CONTINUE.
CONTINUE FOREACHused where the enclosing loop isn't aFOREACHloop, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check whether the
FOREACHstatement was accidentally deleted, per the official guidance. - If the loop type was changed to
WHILE/FOR, update theCONTINUEkeyword to match, per the official guidance.
Examples
CONTINUE FOREACH inside a FOR loop
FOR i = 1 TO 10
CONTINUE FOREACH
-- -4352: this is a FOR loop, not a FOREACH loop
END FOR
Corrected
FOR i = 1 TO 10
CONTINUE FOR
END FOR
Diagnostic Checks
- Check the enclosing loop's actual type, and match the
CONTINUEkeyword to it.
Related Errors / Related Topics
- -4315 — "The program cannot exit a FOREACH statement at this point because it is not
within a FOREACH statement." The
EXIT FOREACHcounterpart of this sameCONTINUE FOREACHcondition. - -4350 — "The program cannot continue a FOR loop at this time because it is not within
a FOR loop." The same pattern applied to
FORinstead ofFOREACH. - -4351 — "The program cannot continue a WHILE loop at this time because it is not
within a WHILE loop." The same pattern applied to
WHILEinstead ofFOREACH.
CONTINUE FOREACH is used outside a FOREACH loop — match the CONTINUE keyword to the
loop's actual type.