for (var i = 1; i <= 100000; i++) { db.testdata2.insert( { x : i , name: "MACLEAN" , name1:"MACLEAN", name2:"MACLEAN", name3:"MACLEAN"} ) } use testdata2 for(var i=1;i<=10000;i++){db.data.insert({ x:i,n…
一 Oracle 循环插入测试数据 declare maxrecords constant int:=1000; i int :=1; begin for i in 1..maxrecords loop insert into UserInfo(UserID,login,password,firstName,lastName,ISADMINISTRATOR) values(SYS_GUID(),TO_CHAR('9999'+i),'password','fri…
一万条数据批量插入和循环插入 循环插入 var startTime = (new Date()).getTime() var db = connect('log') for(var i = 0;i<10000;i++){ db.test.insert({num:i}) } var runTime = (new Date()).getTime()-startTime print('insert time is '+ runTime) // 第一次 2699ms // 第二次 2743ms // 第…
实验中经常会遇到需要多条数据的情况就想到了用SQL语句循环生成数据 DROP PROCEDURE if EXISTS test_insert; DELIMITER ;; CREATE PROCEDURE test_insert() BEGIN DECLARE y BIGINT DEFAULT 1; WHILE y<100000 DO INSERT INTO `sshshop`.`product` (`pname`, `market_price`, `shop_price`, `image`, `…