(mysql.info) while-statement
Info Catalog
(mysql.info) repeat-statement
(mysql.info) flow-control-constructs
17.2.10.7 `WHILE' Statement
...........................
[BEGIN_LABEL:] WHILE SEARCH_CONDITION DO
STATEMENT_LIST
END WHILE [END_LABEL]
The statement list within a `WHILE' statement is repeated as long as the
SEARCH_CONDITION is true. STATEMENT_LIST consists of one or more
statements.
A `WHILE' statement can be labeled. END_LABEL cannot be given unless
BEGIN_LABEL also is present. If both are present, they must be the same.
Example:
CREATE PROCEDURE dowhile()
BEGIN
DECLARE v1 INT DEFAULT 5;
WHILE v1 > 0 DO
...
SET v1 = v1 - 1;
END WHILE;
END
Info Catalog
(mysql.info) repeat-statement
(mysql.info) flow-control-constructs
automatically generated byinfo2html