sql 数据库循环插入100条记录! 怎么实现? 是不是得用存储过程啊

如题所述

1、创建测试表,

create table test_loop(id varchar2(20),remark varchar2(20));

2、循环插入测试数据;

begin

  for i in 1..100 loop

     insert into test_loop

values(i,'level_'||i);

  end loop;

commit;

end;

3、查询表中全量数据;select t.*, rowid from test_loop t;

4、编写语句,查询表中记录数,可以看到结果为100;

   select count(*) sec from test_loop t ;

温馨提示:答案为网友推荐,仅供参考
大家正在搜