如何修复 MySQL CREATE FUNCTION 查询?
我想添加mysql功能:
CREATE FUNCTION `chf_get_translation`(translation_id INT, site_lang INT)
RETURNS text CHARSET utf8
BEGIN
DECLARE translation TEXT;
SELECT title
INTO translation
FROM chf_translations
WHERE key_id = translation_id
AND lang_id = site_lang;
RETURN translation;
END
但出现错误:
1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 3 行 '' 附近使用的正确语法
I want to add mysql function:
CREATE FUNCTION `chf_get_translation`(translation_id INT, site_lang INT)
RETURNS text CHARSET utf8
BEGIN
DECLARE translation TEXT;
SELECT title
INTO translation
FROM chf_translations
WHERE key_id = translation_id
AND lang_id = site_lang;
RETURN translation;
END
But get error:
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 '' at line 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试...
Try...