baidu_30282747 2015-08-03 07:27 采纳率: 0%
浏览 1398

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 ;

  • 写回答

3条回答 默认 最新

  • threenewbee 2015-08-03 07:32
    关注

    报什么错误,这种情况应该是你的存储过程有语法错误,并且mysql会报告的。

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序