MySQL Stored Procedure Programming: Building High-Performance Web Applications in MySQL

Category: Programming
Author: Guy Harrison, Steven Feuerstein
This Month Stack Overflow 1


by anonymous   2017-08-20

This question is over a year old. It deserves an answer. Here it goes:

I just saw this question today in the DBA StackExchange : How long will a temporary MEMORY table persist if I don't drop it (MySQL). I just answered it. In part I said this:

According to the Book


Chapter 5 has a subheading Returning Result Sets to Another Stored Procedure.

It says in paragraph 2 on Page 117:

Unfortunately, the only way to pass a result set from one stored procedure to another is to pass the results via a temporary table. This is an awkward solution b, and -- because the temporary table has scope throughout the entire session -- it creates many of the same maintainability issues raised by the use of global variables. but if one stored program needs to supply another stored program with results, then a temporary table can be the best solution.

Although the question was dropped because of spelling the table wrong, this viewpoint needs to expressed and learned by all who call MySQL Stored Procedures and need their data available.