This is an automated archive.

The original was posted on /r/mysql by /u/TheRealLifeboy on 2023-08-04 15:26:47+00:00.


We have a crontab job that call a mysql sp that calls a bunch of others. It all works well, but we would like to see what mysql returns after each of these completes. (ie, if the sp was run alone it would return “1451 rows updated” for example)

BEGIN  
SELECT '=== start ===';  
SELECT 'Step 1: Do something';  
CALL 01_update_abc();  
SELECT 'Step 2: Do more';  
CALL 02_update_def();  
...  
SELECT 'all done';  
END  

So what did “01_update_abc” return? That’s what we would like to echo with a select statement as well, like we do the comments between the different calls. How can we do that?