procédure et variable
Bonjour,
je cherche à faire quelque chose de tout simple et pourtant...
Voilà mon code :
CREATE PROCEDURE `test2`( nb int )
BEGIN
SET @limitsql = nb;
SELECT * FROM message LIMIT @limitsql;
END
en fait je veux pouvoir passer des variables à mon select et la impossible. J'ai le message
#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 '@limitsql;
END' at line 4
si je fais
CREATE PROCEDURE `test3`( nbpush int )
BEGIN
SET @limitsql = nbpush;
SELECT @limitsql;
END
ça marche
Si vous avez des idées...
Merci d'avance,
Subject
Views
Written By
Posted
procédure et variable
3751
July 22, 2010 08:42AM
1978
July 22, 2010 11:04AM
1616
July 23, 2010 07:58AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.