[Mysql] sql optimized stored procedure (two)

前言

Learn stored procedures

实例

BEGIN
	#Routine body goes here...
	select id from t_user_info where id = n;
END

Insert picture description here

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

Guess you like

Origin blog.csdn.net/s1441101265/article/details/114982470