LEAVE Statement

Continues execution by leaving a compound statement or LOOP.

Quick Links:

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

LEAVE statement-label

Examples

(back to top)

Usage

(back to top)

LEAVE is a control statement that lets you leave a labeled compound statement or a labeled loop. Execution resumes at the first statement after the compound statement or loop.

The compound statement that is the body of a procedure has an implicit label that is the same as the name of the procedure.

Standards

(back to top)

  • SQL—ISO/ANSI SQL compliant.
  • SAP Sybase Database product—Not supported in Adaptive Server. The break statement provides a similar feature for Transact-SQL compatible procedures.

Permissions

(back to top)

None

Related reference
BEGIN … END Statement
FOR Statement
LOOP Statement