How to put "EXECUTE statement;" result into a variable so that I can get the result using simple SELECT command whenever I need it. The result will contain random number of column based on user inputs. So, what I want is something like:
SET @RES := EXECUTE stmt;
and then I may apply-
SELECT @RES;
On a second thought, I want the result in-
WITH res_set1 AS (
EXECUTE stmt;
)
SELECT * FROM res_set1;
Thanks in advance.