by pmartyn » Wed Apr 24, 2013 3:45 am
You should look at creating a Temporary Table. The table can hold data for you and terminates at the end of the connection thread. Here are more details if you are using a compound statement;
If a DECLARE GLOBAL TEMPORARY TABLE statement is specified within the SQL procedure compound statement (defined by BEGIN and END), the scope of the declared global temporary table is the connection, not just the compound statement, and the table is known outside of the compound statement. The table is not implicitly dropped at the END of the compound statement. A declared global temporary table cannot be defined multiple times by the same name in other compound statements in that session, unless the table has been explicitly dropped