I created several stored procedures in phpmyadmin,

2019-05-07 19:22发布

问题:

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.