Bug #42781 How to return more than one result set(Table grids) through stored procedure
Submitted: 12 Feb 2009 6:47 Modified: 12 Feb 2009 7:36
Reporter: Hema latha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.1 OS:Windows
Assigned to: CPU Architecture:Any

[12 Feb 2009 6:47] Hema latha
Description:
I am using two temp tables in my procedure.I want to return both the tables as the
result set.

The following is my procdure 

DELIMITER $$

DROP PROCEDURE IF EXISTS `facebook`.`ReturningBackArraytoflash`$$

CREATE DEFINER=`sa`@`172.16.0.39` PROCEDURE `ReturningBackArraytoflash`(In gid int,In uid int)
BEGIN
  
 CREATE TEMPORARY table singleperson as
SELECT userid,Shuffled_cards,deck_cards,open_cards from cardtable where userid =uid
  and gameid=gid;
  select * from singleperson;
 CREATE TEMPORARY table otherpersondetails as     
SELECT c.userid,u.name,g.gamename,
ROUND((length(c.Shuffled_cards)-length(REPLACE(c.Shuffled_cards, ',', '')))+1/length(',')) as len
from cardtable c,users u,gametable g where c.gameid=gid and c.userid<>uid
and u.userid=c.userid and c.gameid=g.gameid;

  select * from otherpersondetails;

drop table singleperson;
drop table otherpersondetails;
    END$$

The first temp table cotains the fields and values like:
 
userid  Name     gamename   len
6       Orelley  g1         1

The second temp table contains the field and values like:

userid  deck_cards   open_cards   shuffledcards
6        c1,de         k1,g1         p1,p3

I want to return both tables in a single procedure.How to do

How to repeat:

Repeate twice a day
[12 Feb 2009 7:36] Valeriy Kravchuk
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.