Je veux ajouter la fonction mysql:Comment réparer la requête 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
Mais obtenir l'erreur:
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
Cela aide grâce; Mais maintenant j'obtiens l'erreur: ERREUR 1418 (HY000): Cette fonction n'a aucun de DETERMINISTIC, aucun SQL, ou READS SQL DATA dans sa déclaration et l'enregistrement binaire est permis (vous * pourriez * vouloir employer la variable log_bin_trust_function_creators moins sûre – Liutas
J'ai trouvé la réponse. J'ai besoin de "READS SQL DATA" après "RETURNS text CHARSET utf8" – Liutas