问题描述
- mysql中存储过程无法创建成功
-
delimiter $$
BEGIN
DECLARE iti varchar(25);
declare maj varchar(25);
declare cla tinyint(1);
declare buffer tinyint(1);
declare grd enum('2014级','2012级','2013级');
declare mycur CURSOR for select institude,major,grade,class from show_information;
open mycur;
fetch mycur into iti,maj,grd,cla;
while(iti is not null)DO
select buffer=count(*) from show_information where institude=iti and major=maj and grade=grd and class=cla;
update statistics set classnum=buffer where institude=iti and major=maj and grade=grd and class=cla;
fetch mycur into iti,maj,grd,cla;
end while;
close mycur;
END
$$
delimiter ;
解决方案
报什么错误,这种情况应该是你的存储过程有语法错误,并且mysql会报告的。
解决方案二:
mysql无法创建存储过程(stored procedure
解决方案三:
delimiter $$ 把前后的都去掉
解决方案四:
mysql没有这种buffer=count()
可以用select into
时间: 2024-10-06 13:42:47