delimiter //
DROP PROCEDURE IF EXISTS proc_buildata;
CREATE PROCEDURE proc_buildata(IN loop_times INT)
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i<=loop_times DO
INSERT INTO `t_sys_log`(`id`, `type`, `access_url`, `access_method`, `access_name`, `ip`, `mac`, `creator_id`, `create_date`, `modifier_id`, `modify_date`, `valid`, `version`, `saas_code`) VALUES (i, '1', 'http://localhost:8811/api/system/memos/list', 'GET', '获取备忘录', '127.0.0.1', NULL, '1', '2020-03-05 17:41:50', '1', '2020-03-05 17:41:50', '1', 0, 'super');
SET i=i+1;
END WHILE;
END //
delimiter;
CALL proc_buildata(100);
mysql使用存储过程批量造数据
最新推荐文章于 2024-09-05 20:26:16 发布