I am working on a stored proc (parent) that calls another stored proc (child). The child proc returns a record set with 1 row every time.
What I need to do is pull the data from the child proc and use it in the parent proc. Using methodology from MSSQL I would assume I could just populate a temp table, but I am not quite sure how to do this.
Any help with this is greatly appreciated.
Here is the current version of my proc.
DELIMITER//
CREATE PROCEDURE CreateTransaction(IN p_TransType tinyint, in p_UserID INT)
BEGIN
DROP TEMPORARY TABLE IF EXISTS fileData_tmp;
CREATE TEMPORARY TABLE fileData_tmp (t_FilePrefix varchar(5), t_FileSuffix int, t_FileDate varchar(4));
CALL GenerateFileNumber(p_TransType);
END//
DELIMITER;
If you’re trying to return a value, why not use a function instead of a procedure?
Here’s how it works: