20171010-造数据脚本

declare
 my_data table_name%rowtype;
 my_num number;
begin
  select col1,col2 into my_data from table_name t where col_name = '110101201605165';
  for my_num in 1..10000000
    loop
      insert into table_name t (t.col1,t.col2)
                         values (my_num, my_data.col2);
      if  mod(my_num,10000) = 0 then
        commit;
      end if;
    end loop;
    commit;
end;

精简许多,感觉还可以

posted @ 2017-10-11 09:44  Oracle-fans  阅读(588)  评论(0编辑  收藏  举报