DROP PROCEDURE IF EXISTS `Test_Procedure01`; DELIMITER $$ CREATE PROCEDURE `Test_Procedure01`() BEGIN -- 定义变量 DECLARE v_i int unsigned DEFAULT 0; WHILE v_i < 5 DO SELECT v_i; SET v_i = v_i 1; END WHILE; END $$ DELIMITER ; call Test_Procedure01();
DROP PROCEDURE IF EXISTS `Test_Procedure01`; DELIMITER $$ CREATE PROCEDURE `Test_Procedure01`() BEGIN -- 定义变量 DECLARE v_i int unsigned DEFAULT 0; WHILE v_i < 5 DO SELECT v_i; SET v_i = v_i 1; END WHILE; END $$ DELIMITER ; call Test_Procedure01();