0
我想添加MySQL功能:如何解决MySQL的CREATE 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
,但得到的错误:
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
这有助于感谢; 但现在我得到错误: 错误1418(HY000):此函数在其声明中没有DETERMINISTIC,NO SQL或READS SQL DATA,并且二进制日志记录已启用(您可能*希望使用不太安全的log_bin_trust_function_creators变量) – Liutas 2010-06-15 08:44:30
我找到答案。在“返回文本CHARSET utf8”之后,我需要“READS SQL DATA” – Liutas 2010-06-15 08:55:53