mysql存储过程--往表中批量插入数据
生活随笔
收集整理的这篇文章主要介绍了
mysql存储过程--往表中批量插入数据
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
为什么80%的码农都做不了架构师?>>>
1、创建表:
create test_a( id int);
2、创建存储过程
delimiter $$
create procedure batch_insert()begin
DECLARE max int;
DECLARE rc int;
set max =10000;
set rc =1;
loopl: while rc<max do
insert into test_a values(rc);
set rc=rc+1;
end while loopl;
end$$
delimiter ;
3、调用存储过程:
call batch_insert();
转载于:https://my.oschina.net/binXu/blog/108773
总结
以上是生活随笔为你收集整理的mysql存储过程--往表中批量插入数据的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: oc中单例
- 下一篇: Ubuntu 12.04 MySQL改u