右键新建过程,选择完成。编写函数,运行即可。
CREATE DEFINER=`root`@`localhost` PROCEDURE `plInsertCom`()
BEGIN
#Routine body goes here...
DECLARE i int;
set i=0;
while i<10000 do
INSERT into commodity(name,price,type_id,count,`describe`) VALUES ('name2',1,1,1,'text');
set i=i+1;
END WHILE;
END