oracle批量导入测试数据
一、Test Windos方式
declare
        maxrecords constant int:=1000;
        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;
lunzi   2008-01-17 21:05:25 评论:0   阅读:3047   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog