Loops are a construct that causes Oracle to repeat the same set of code. This is an important tool for processing records. A loop can contain numerous statements and logic. These statements can then be applied to each individual record in a set, thereby allowing the developer to use the same statement to modify many records.
There are three types of looping structures: LOOP, WHILE, and FOR. The former two structures will be discussed in this section. The FOR looping structure will be discussed in the next section.
Each of the loop structures has three things in common:
Each structure contains the LOOP keyword.
Each structure ends with the END LOOP keywords.
Each structure uses a conditional expression to determine whether to stop the looping. ...