The CONTINUE
statement exits the current iteration of a loop, either conditionally or unconditionally, and transfer control to the next iteration. You can name the loop to be exited.
Keyword and Parameter Descriptions
If and only if the value of this expression is TRUE
, the current iteration of the loop (or the iteration of the loop identified by label_name
) is exited immediately.
An unconditional CONTINUE
statement (that is, one without a WHEN
clause) exits the current iteration of the loop immediately. Execution resumes with the next iteration of the loop.
Identifies the loop exit from either the current loop, or any enclosing labeled loop.
A CONTINUE
statement can appear anywhere inside a loop, but not outside a loop.
If you use a CONTINUE
statement to exit a cursor FOR
loop prematurely (for example, to exit an inner loop and transfer control to the next iteration of an outer loop), the cursor is closed automatically (in this context, CONTINUE
works like GOTO
). The cursor is also closed automatically if an exception is raised inside the loop.