create table t_a(id number);
--使用循环直接插入数据
begin
for i in 1..100000 loop
insert into t_a(id) values(i);
end loop;
end;
--使用Forall批量插入数据
declare
type a_table_type is table of number index by binary_integer;
v_a_s a_table_type;
begin
for i in 1..100000 loop
v_a_s(i) := i;
end loop;
--使用Forall插入数据
forall m in 1..v_a_s.count
insert into t_a values(v_a_s(m));
end;
|