mysql 5.7 创建存储过程报错

匿名 (未验证) 提交于 2019-12-02 22:06:11

创建存储过程:

    mysql> delimiter //     mysql> create procedure delete_yy         -> begin         -> select * from student;         -> end // 

报错如下:

ERROR 1064 (42000): 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 'begin

解决:
存储过程名后加上括号即可

mysql> create procedure delete_yy() begin select * from student; end// Query OK, 0 rows affected (0.01 sec)

不过看其他博客,包括在navicat上,都不会因为少括号报错,路过的大佬如果知道评论一声==

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!