zylZYL13621804880
zylZYL13621804880
2019-06-11 11:52

mysql 存储过程定义变量出错

  • mysql

各位大佬帮忙看看哪里有语法错误
CREATE PROCEDURE update_customer_code ()
BEGIN
DECLARE mysort INT;
   
   

    DECLARE done tinyint;

        DECLARE customerId VARCHAR;
        DECLARE cur CURSOR FOR SELECT customer_id FROM customer_association_process;

    OPEN cur;  
WHILE done DO
FETCH cur INTO customerId;

                CALL superior_splice (customerId);

     
SET mysort = mysort + 1;   
END
WHILE;
    CLOSE cur;
END;

错误提示:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 
    SET mysort = 1;
    DECLARE done tinyint;
SET done = 1;
D' at line 4

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐