MySQL syntax error in WHILE statement

前端 未结 1 565
挽巷
挽巷 2021-01-19 23:33

I\'m working through learning MySQL (v 5.6) and trying to get a simple WHILE loop to go through. I even just straight copy & paste from the manual (with add

相关标签:
1条回答
  • 2021-01-19 23:45

    The procedure looks ok I guess you are missing the delimiter

    delimiter //
    CREATE PROCEDURE dowhile()
      BEGIN
       DECLARE v1 INT DEFAULT 5;
        WHILE v1 > 0 DO
         SET v1 = v1 - 1;
       END WHILE;
     END; //
    delimiter ;
    
    0 讨论(0)
提交回复
热议问题