Hi Folks,
We're having a small issue and could use some help - we have the need to combine multiple resultsets from one stored procedure into one resultset (the limitation of our Java reporting framework). We've looked at Union, etc. but the problem is that the stored procedure resultsets are multiple crosstab results and the (1) number of columns for each resultset are unknown and (2) the column names for each resultset are unknown.
Basically, if the sp_ has 3 results like:
ID Name
1 Sam
2 Time
ID FName LName
1 John Jacob
2 Tim Test
3 Sam Hopkins
ID Amount
1 1000
2 5000
The ideal result would basically return the above text as-is which our framework would print to the user. Also please note that these 3-4 resultsets are not related to each other.
We're using SQL Server 2000 and Java 1.4.
Any advice would be appreciated.
Thanks, SP
PS: An alternative explaination in case the one above is not very clear. In SQL Query Analyzer if we have 3 select statements:
select * from countries; {returns id,countryname,countrycode}
select * from people; {id,countryname,countrycode}
select * from balance; {id,countryname,countrycode}
Then the results are displayed in three separate resultset boxes. We need to these resultsets to be returned as one resultset by the stored procedure (while not knowing the number/name of the columns due to the crosstab-ing taking place). Thanks.