右鍵新建過程,選擇完成。編寫函數,運行即可。
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