declare
maxnumber constant int:=200;
i int :=1;
begin
for i in 1..maxnumber loop
insert into test(dbid,name,address)
values(SEQ_TEST.Nextval,'男','山东临沂');
end loop;
commit;
maxnumber constant int:=200;
i int :=1;
begin
for i in 1..maxnumber loop
insert into test(dbid,name,address)
values(SEQ_TEST.Nextval,'男','山东临沂');
end loop;
commit;
end;
今天要做一个批量插入数据,让用sql实现。嘿嘿,让自己又回顾了一下oracle的循环。
新建了一个叫test的表,然后测试了一下,发现是对的。以上可以执行 ^_^