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