PreviousSQL Engine Reference (v9 SP2 (9.5) revision 1) Next

LEAVE

Chapter contents

Remarks

A LEAVE statement continues execution by leaving a block or loop statement. You can use LEAVE statements in the body of a stored procedure or a trigger.

Examples

The following example increments the variable vInteger by 1 until it reaches a value of 11, when the loop is ended with a LEAVE statement.

TestLoop: 
LOOP 
IF (:vInteger > 10) THEN 
LEAVE TestLoop; 
END IF; 
SET :vInteger = :vInteger + 1; 
END LOOP;

See Also

IF

LOOP


Chapter contents
Book contents

Prev topic: JOIN
Next topic: LIKE