CREATE DEFINER=`root`@`%` PROCEDURE `batchInsert`(IN loop_times INT) BEGIN DECLARE var INT; SET var = 0; set @exeSql=concat("insert into cdb_dynamic (typeId,addTime,userId) VALUES (1,1470540371,1)"); WHILE var < loop_times DO set @exeSql=concat(@exeSql,", (1,1470540371,1)"); SET var = var + 1; END WHILE; prepare stmt from @exeSql; EXECUTE stmt; deallocate prepare stmt; END;
时间: 2024-10-15 05:47:28