mysql - 如何解决mysql程序中的语法错误?

标签 mysql stored-procedures


我正在 mysql 中执行一个过程,过程是-

delimiter $$
create procedure getFacility (in id int, out MyFacility VARCHAR(200))
begin
    select Facility into MyFacility 
        from facilities 
        where FacilityID = id ;
end $$
delimiter ;

它在下面给出错误-

Error Code : 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 'end $$
delimiter' at line 1
(0 ms taken)

如何解决这个错误?

谢谢,
尤加尔

最佳答案

我认为错误是因为 END$$ 之间的空格。 尝试 END$$,它应该可以正确编译。

http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html

关于mysql - 如何解决mysql程序中的语法错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5063051/

相关文章:

mysql - mysql中同步存储过程执行

sql - 在存储过程中验证密码

postgresql - 在 Postgresql 存储过程中使用准备好的语句或动态命令?

用逗号分隔的数字列表的 MySQL 奇怪行为

php - doctrine2 内部连接对象中的数据

Mysql根据1行更新6行

mysql - LIMIT 不适用于 MySQL 8.0 存储过程中的用户定义参数

mysql - 子查询给我不同的结果

c# - MySql 异常 : The timeout period elapsed prior to obtaining a connection from the pool

MySQL-使用游标删除存储过程