Skip to Main Content
Oracle in a Nutshell
book

Oracle in a Nutshell

by Rick Greenwald, David C. Kreines
December 2002
Intermediate to advanced content levelIntermediate to advanced
928 pages
85h 29m
English
O'Reilly Media, Inc.
Content preview from Oracle in a Nutshell

Loop Statements

The LOOP construct allows you to repeatedly execute a sequence of statements. There are three kinds of loops: simple, WHILE, and FOR; there are two variants on the FOR loop: the numeric FOR loop and the CURSOR FOR loop.

All loops can have a label or contain an EXIT statement.

Loops can be optionally labeled to improve readability and execution control. The label must appear immediately in front of the statement that initiates the loop.

The EXIT statement is used to break out of the loop and pass control to the statement following the END LOOP. The syntax for the EXIT statement is:

EXIT [WHEN Boolean_condition];

If you do not include a WHEN clause in the EXIT statement, it will terminate the loop unconditionally. Otherwise, the loop terminates only if Boolean_condition evaluates to TRUE. The EXIT statement is optional and can appear anywhere in the loop.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Internals

Oracle Internals

Donald K. Burleson
Oracle PL/SQL

Oracle PL/SQL

Lewis Cunningham
Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Rick Greenwald, Robert Stackowiak, Jonathan Stern

Publisher Resources

ISBN: 0596003366Errata Page