存储过程创建和调用
DELIMITER $$
DROP PROCEDURE IF EXISTS bxx$$
CREATE PROCEDURE bxx()
BEGIN
DECLARE x INT;
DECLARE str VARCHAR(255);
SET x = 1;
SET str = '';
WHILE x <= 5 DO
INSERT INTO `ancb_yun`.`test`(`id`, `code`, `name`, `price`, `create_time`) VALUES (null, 1, '1', '1', '2020-02-24 18:23:35');
SET x = x + 1;
END WHILE;
END$$
DELIMITER ;
-- 调用
call bxx();