Comments - CALL

5 years, 8 months ago Chase Carter

What is the syntax for calling multiple stored procedures within a procedure? I can get a single CALL to work fine but not multiple.

 
5 years, 7 months ago Ian Gilfillan

You need to give more details. The following simple example works:

DELIMITER $$

CREATE PROCEDURE sp1()
BEGIN
  SELECT 1;
END $$

CREATE PROCEDURE sp2()
BEGIN
  SELECT 2;
END $$

CREATE PROCEDURE sp3()
BEGIN
  call sp1;
  call sp2;
END $$

call sp1;
+---+
| 1 |
+---+
| 1 |
+---+

call sp2;
+---+
| 2 |
+---+
| 2 |
+---+

call sp3;
+---+
| 1 |
+---+
| 1 |
+---+

+---+
| 2 |
+---+
| 2 |
+---+

DELIMITER ;
 
5 years, 7 months ago Joseph Higgs

Same issue for me. Did you find something that works?

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.