11.12. LOOP

PL/SQL supports the following loop constructs:

  • Infinite LOOP with an exit condition

  • FOR LOOP

  • WHILE LOOP

11.12.1. DO UNTIL LOOP

The DO UNTIL LOOP always performs some piece of work, until an exit condition occurs. This LOOP can terminate with an EXIT WHEN statement or an IF condition with an EXIT. If no termination condition occurs then this becomes an infinite loop. As with any loop, an exception, such as divide by zero, can break the loop. Figure 11-5 shows the DO-UNTIL LOOP construct.

Figure 11-5. DO UNTIL LOOP.

The DO UNTIL LOOP always makes at least one pass through the loop block. Following each pass is the test for continuing. ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.