The code for Create_dorepeat_proc.sql is: DROP PROCEDURE IF EXISTS dorepeat; DELIMITER $$ CREATE PROCEDURE test.dorepeat(p1 INT) BEGIN SET @x = 0; REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT; END$$ DELIMITER ; CALL test.dorepeat(5); SELECT @x; CALL dorepeat(10); SELECT @x; SHOW CREATE PROCEDURE dorepeat;