Salut,
je shouaites automatiser mes ajouts de news / fichiers... ect, pour mon blog.
J'ai fais pour le moment des choses toutes simples : INSERT INTO, DELETE FROM ect...
Mais j'aimerais automatiser les requettes : faire un truc genre SUPPR_ARTICLE(42);
je me suis inspiré de :
http://dev.mysql.com/doc/refman/5.0/fr/declare-handlers.html
pour faire une petite fonction (pas encore une procédure ^^ j'y vais pas à pas...)
j'ai testé :
CREATE FUNCTION hello (@s CHAR(20)) RETURNS CHAR(50)
RETURN CONCAT('Hello, ',@s,'!')
et on me renvoi : Erreur SQL !
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 '(@s
CHAR(20)) RETURNS CHAR(50)
RETURN CONCAT('Hello, ',@s,'!')
sur une console php, et
mysql> CREATE FUNCTION hello (@s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',@s,'!')
-> \G
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 '(@s CHAR(20)) RETURNS CHAR(50) RETURN
CONCAT('Hello, ',@s,'!')'
mysql>
merci d'avance !
In a dream, I saw me, drop dead... U was here, U cried... It was just a deam, if I die, U won't cry, maybe, U'll be happy
[ Lien ]