Skip Headers
Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)

Part Number E10472-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

EXIT Statement

The EXIT statement exits the current iteration of a loop, either conditionally or unconditionally, and transfers control to the end of either the current loop or an enclosing labeled loop.

An EXIT statement can appear anywhere inside a loop, but not outside a loop.

Topics:

Syntax

exit_statement ::=

exit_statement
Description of the illustration exit_statement.gif

See boolean_expression ::=.

Semantics

label

A label that identifies either the current loop or an enclosing loop (see "Basic LOOP Statement").

Without label, the EXIT statement transfers control to the end of the current loop. With label, the EXIT statement transfers control to the end of the loop identified by label.

WHEN boolean_expression

Without this clause, the EXIT statement exits the current iteration of the loop unconditionally. With this clause, the EXIT statement exits the current iteration of the loop if and only if the value of boolean_expression is TRUE.

Examples

Related Topics

In this chapter: