I created several stored procedures in phpmyadmin, how to call them using an sql query?
I created 开发者_开发知识库several stored procedures in phpmyadmin, how is it possible to call them using an sql query (mysql) ?
CALL name_of_stored_procedure(parameters);
Try this on the 'SQL' tab:
CREATE DEFINER=`root`@`localhost` PROCEDURE `storedprocedure1`(OUT myvar1 CHAR(64))
SET myvar1="IT ";
CREATE DEFINER=`root`@`localhost` PROCEDURE `storedprocedure2`(OUT myvar2 CHAR(64))
SET myvar2="WORKS";
Then call:
CALL procedure1(@var1);
CALL procedure2(@var2);
SELECT @var1,@var2;
the above example does work except for typo - should be:
CALL storedprocedure1(@var1);
CALL storedprocedure2(@var2);
SELECT @var1,@var2;
just missed the "stored" prefix of the procedure name off the the CALL's
As far as I know phpmyadmin doesn't support this.
精彩评论