前言
学习存储过程
实例
BEGIN
#Routine body goes here...
select id from t_user_info where id = n;
END
- 批量插入
具体实现参考的哪个找不到了,不过这篇写的也不错,所以就贴上来了
文章:https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/87855148
BEGIN
declare i int default 1;
start transaction; #开启事务
while i <= 1000000 do
insert into test_indexes
values(i, concat("张天爱-", i), '测试字段', '测试字段', '测试字段', '测试字段', '测试字段', '测试字段', '测试字段', '测试字段');
set i = i+1;
end while;
commit;
END