Informix Error -26030: Invalid usage of EXIT or CONTINUE statement, which should be within a st atement loop.
Cause and resolution
Invalid usage of EXIT or CONTINUE statement, which should be within a st atement loop.
Within the SPL routine,EXIT and CONTINUE statements must be placed within a WHILE, FOR or LOOP statement loop.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-26030 fires when an SPL EXIT/CONTINUE statement appears outside a loop — per the
official guidance.
EXIT/CONTINUEused outside aWHILE,FOR, orLOOPstatement, per the official guidance — the direct, only cause; both must be inside a loop.
Solutions / Resolution
- Move the
EXIT/CONTINUEstatement inside aWHILE,FOR, orLOOPblock, per the official guidance.
Examples
An EXIT outside any loop
CREATE PROCEDURE testproc()
LET x = 1;
EXIT;
-- -26030: not inside a WHILE/FOR/LOOP
END PROCEDURE;
Diagnostic Checks
- Check every
EXIT/CONTINUEstatement's enclosing block, and confirm it's aWHILE,FOR, orLOOPstatement.
Related Errors / Related Topics
- -26032 — "Invalid label label-name used with EXIT WHEN clause." A related
EXIT-usage error, on an invalid label rather than being outside a loop entirely.
An EXIT/CONTINUE statement appeared outside a WHILE/FOR/LOOP block — move it
inside one.