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

I created several stored procedures in phpmyadmin, how can I call them using a SQL query (mysql)?

+4
source share
3 answers
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; 
+4
source

the above example works, with the exception of typo - should be:

 CALL storedprocedure1(@var1); CALL storedprocedure2(@var2); SELECT @var1,@var2; 

just skipped the "saved" prefix of the procedure name from CALL

+4
source

As far as I know, phpmyadmin does not support this.

-4
source

Source: https://habr.com/ru/post/1332771/


All Articles