LOOP allows you to iterative sequence of statements repeatedly for a specified number of times. The
EXIT WHEN is used to terminate the loop iteration. Here remember that the
WHEN statement can be used interchangeably.
To terminate the loop iteration, use the following syntax:
Let's understand how it works: