开发者

I created several stored procedures in phpmyadmin, how to call them using an sql query?

开发者 https://www.devze.com 2023-01-31 23:29 出处:网络
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);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消