begin_label:] BEGIN [
statement_list] END [
statement_listEND LOOP [
search_conditionEND REPEAT [
statement_listEND WHILE [
begin_label must be followed by a
begin_label can be given without
end_label is present, it must be
the same as
end_label cannot be given without
Labels at the same nesting level must be distinct.
Labels can be up to 16 characters long.
CREATE PROCEDURE doiterate(p1 INT) BEGIN label1: LOOP SET p1 = p1 + 1; IF p1 < 10 THEN ITERATE label1; END IF; LEAVE label1; END LOOP label1; END;
The scope of a block label does not include the code for handlers declared within the block. For details, see Section 22.214.171.124, “DECLARE ... HANDLER Syntax”.
Copyright © 1997, 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices