循环插入记录,id每次加1

sql语句写法:

begin

  for i in 1 .. 100

    loop

      insert into table_name values(....);

    end loop;

commit;

end;

例子:

begin

  for i in 1 .. 100

    loop

insert into toilet values(i+1,null,'张三');

    end loop;

commit;

end;

 

posted @ 2017-03-08 13:10  zero_and_one  阅读(607)  评论(0编辑  收藏  举报