LEAVE
Exit a labeled block or loop immediately. This statement terminates the execution of the current loop or compound statement and continues after the block.
Syntax
LEAVE labelERROR 1308 (42000): LEAVE with no matching label: <label_name>CREATE PROCEDURE proc(IN p TINYINT)
CONTAINS SQL
`whole_proc`:
BEGIN
SELECT 1;
IF p < 1 THEN
LEAVE `whole_proc`;
END IF;
SELECT 2;
END;
CALL proc(0);
+---+
| 1 |
+---+
| 1 |
+---+See Also
Last updated
Was this helpful?

