每秒迴圈插入資料

張玉龍發表於2016-09-26


create tablespace TEST datafile 'C:\ORACLE\ORADATA\ORCL\TEST01.DBF' size 100M autoextend on;

create user TEST identified by test default tablespace TEST;

grant connect,resource,create view to TEST;


create table TEST.test2(id number(20),sj date,sj2 date,sj3 date,sj4 date);


create sequence test_seq
minvalue 1
maxvalue 100000
start with 1
increment by 1
cache 20;

declare
maxrecords constant int:=100000;
i int :=1;
begin
for i in 1..maxrecords loop
insert into TEST.test2
values
(test_seq.nextval,sysdate,sysdate,sysdate,sysdate);
commit;
dbms_lock.sleep(1);
end loop;
end;
/










相關文章