The innermost loop is terminated, and the statement following
END LOOP is executed next.
WHEN is present, loop exit occurs only if the specified condition is
TRUE. Otherwise control passes to the statement after
You can use
EXIT to cause early exit from all types of loops, not just unconditional loops.
This example shows a loop that iterates 10 times and then uses the
EXIT statement to terminate:
The following is the output from this example: