I created several stored procedures in phpmyadmin, how is it possible to call them using an sql query (mysql) ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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;
回答2:
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
回答3:
As far as I know phpmyadmin doesn't support this.