LEAVE Statement

Continues execution by leaving a compound statement or LOOP.

Syntax

LEAVE statement-label

Examples

Usage

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

  • SQL—ISO/ANSI SQL compliant.

  • Sybase—Not supported in Adaptive Server Enterprise. The break statement provides a similar feature for Transact-SQL compatible procedures.

Permissions

None

Related reference
BEGIN … END Statement
FOR Statement
LOOP Statement