标签:ar cti amp ad ef c sql type mysql
DELIMITER //
CREATE PROCEDURE p_addscore(nums INT,OUT retrows INT)
BEGIN
DECLARE i INT DEFAULT 0;
add_loop:LOOP
IF i >= nums THEN LEAVE add_loop;
END IF;
INSERT s_musicscore (ssid,uid,score,ctime,stype) VALUES(17,UUID(),8,UNIX_TIMESTAMP(),1);
SET i=i+1;
END LOOP add_loop;
SET retrows= i;
END//
DELIMITER ;
#调用
CALL p_addscore(5,@num);
#获取返回值
SELECT @num;
#删除
DROP PROCEDURE p_addscore;
标签:ar cti amp ad ef c sql type mysql
原文地址:http://www.cnblogs.com/shouwu/p/3939060.html