天天看点

oracle循环插入10000条数据(oracle大批量插入数据)

当我们进行测试数据或者进行压力测试时候,需要几十万或者几百万条数据,我们可以用下面语句进行大批量插入,

10万条数据插入时间为7秒左右,100万条记录插入时间为65秒,200万插入为150秒。

declare
i integer ; --定义变量

begin
i := 1;
loop
/* 插入数据 */
insert into test (student, username, password )values('01',  'lisi','123');
i := i + 1;
exit when i > 10000;--插入一万条数据
end loop;
commit;
end;
           

参考:https://blog.csdn.net/iteye_17920/article/details/82334007