« NAT網絡地址轉換的3種實現方式我的CCIE 學習之路 »

oracle批量插入測試數據的方法

 

oracle怎樣批量插入測試數據
        壹、Test Windos方式

  declare

  maxrecords constant int:=100000;

  i int :=1;

  begin

  for i in 1..maxrecords loop

  insert into test2

  (id, name)

  values

  (test2_seq.nextval, to_char(9999+i));

  end loop;

  dbms_output.put_line(’ 成功錄入數據!’);

  commit;

  end;

  二、從已有表中往入另壹張表導數據

  create or replace procedure TestProc is

  begin

  for c in(select id, name from test2) loop

  insert into test

  (id,

  name)

  values

  (test_seq.nextval, c.name);

  end loop;

  end TestProc;

 

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。