PL/SQL provides a LOOP construct for execution of a sequence of statements multiple number of times. There are three forms of LOOP statements: LOOP, FOR-LOOP and WHILE-LOOP.
The basic form of LOOP statement allows unconditional iteration over a number of statements.
To complete the LOOP statement unconditionally or conditionally, the programmer can use EXIT, or EXIT-WHEN statements.
The WHILE-LOOP iterates over the sequence of statements, each time evaluating the condition, executing the statements in case the condition is true and completing execution when the condition is false. FOR-LOOP iterates over the statements for a specified range of integers (Between lower_bound and higher_bound). Codes for both are given below: