Bonjour,
Je suis en train de faire ma première fonction MySQL.
Elle est doit traduire un BIGINT en BLOB.
Seulement voila :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13 DELIMITER | CREATE FUNCTION INFINT_NEW (val BIGINT) RETURNS BLOB DETERMINISTIC BEGIN DECLARE o BLOB; WHILE val DO SET o = CONCAT(o, CHAR(val % 256)); SET val = TRUNCATE(val / 256); END WHILE; RETURN out; END |
Quelqu'un pourrait me m'aider merci.Citation:
ERROR 1064 (42000): 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 'SET val = TRUNCATE(val / 256);
END WHILE;
RETURN out;
END' at line 8
Je n'est pas trouvé de bon tutos sur les FUNCTION mysql.