DELIMITER $$
CREATE PROCEDURE doWhileInsertCity2(
TimesToRun INT
)
BEGIN
DECLARE counter INT DEFAULT 1;
WHILE counter <= TimesToRun DO
-- do something ...
SET counter = counter + 1;
END WHILE;
END$$
DELIMITER ;
execute the loop:
CALL doWhileInsertCity2(15);
No comments:
Post a Comment