O'Reilly logo

Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts by John Adolph Palinski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loops

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:

  1. Each structure contains the LOOP keyword.

  2. Each structure ends with the END LOOP keywords.

  3. Each structure uses a conditional expression to determine whether to stop the looping. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required