3

My question is pretty straight forward. Is it possible to create a procedure that calls multiple previously stored procedures such as:

CREATE PROCEDURE  `CALL_A_B_C` ( ) 
NOT DETERMINISTIC MODIFIES SQL DATA SQL SECURITY DEFINER  
CALL `A` ();
CALL `B`();
CALL `C`();

This code doesn't work but you get the idea. Is there a way to do this?

1 Answer 1

5

The answer yes it is possible. Your code for an outer stored procedure might look like this

DELIMITER $$
CREATE PROCEDURE sp_abc()
BEGIN
  CALL sp_a();
  CALL sp_b();
  CALL sp_c();
END$$
DELIMITER 

Here is SQLFiddle demo

Sign up to request clarification or add additional context in comments.

2 Comments

each call will be asynch or blocking?
@iBabur Sequential. There is no concept of async calls in MySQL or AFAIK any other major RDBMS for that matter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.