search_conditionEND REPEAT [
The statement list within a
REPEAT statement is repeated
is true. Thus, a
enters the loop at least once.
statement_list consists of one or
more statements, each terminated by a semicolon
;) statement delimiter.
CREATE PROCEDURE dorepeat(p1 INT)->
SET @x = 0;->
SET @x = @x + 1;->
UNTIL @x > p1 END REPEAT;->
//Query OK, 0 rows affected (0.00 sec) mysql>
CALL dorepeat(1000)//Query OK, 0 rows affected (0.00 sec) mysql>
SELECT @x//+------+ | @x | +------+ | 1001 | +------+ 1 row in set (0.00 sec)
Copyright © 1997, 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices