如何快速生成此Oracle表的数据?
Table EVENTS
EVENTID NUMBER(38,0)
AGENTID NUMBER(38,0)
EVENTDATE DATE
CPU NUMBER(38,0)
RAM NUMBER
HDD NUMBER
NETWORKUP NUMBER
NETWORKDOWN NUMBER
例如,我可以使用Oracle函数执行1000个插入吗?
答案 0 :(得分:0)
可以使用程序并在需要时调用它。
create or replace procedure addata is
begin
for i in 1..1000 loop
insert into events (EVENTID,
AGENTID ,
EVENTDATE,
CPU,
RAM ,
HDD ,
NETWORKUP,
NETWORKDOWN) values
(i,
i+1,
sysdate,
i+3,
i+4,
i+5,
i+6,
i+7) ;
end loop;
commit;
end;
SCOTT@research 16-APR-15> exec addata;
PL/SQL procedure successfully completed.
SCOTT@research 16-APR-15> select count(*) from events;
COUNT(*)
----------
1000