帮忙调试一段MYSQL的存储过程!
发布网友
发布时间:2022-04-23 01:24
我来回答
共1个回答
热心网友
时间:2022-04-08 00:07
=====================================
/*脚本2开始*/
DECLARE RANDSTR varchar(2) DEFAULT CAST(round(rand()*53) AS char(2));
DECLARE LocationId INT DEFAULT (SELECT `ID` FROM `shuo_Citys` WHERE `PID`>0 ORDER BY rand() Limit 1);
DECLARE Location VARCHAR(50) DEFAULT (SELECT `Name` FROM `shuo_Citys` WHERE `ID`=LocationId);
/*脚本2结束*/
=====================================
这段移到
declare Uid int;
的下一行
原因:declare 必须都在最前面