| Author |
How to retrieve dynamic columns from stored procedure
|
suresh midde
Greenhorn
Joined: Aug 22, 2008
Posts: 25
|
|
Hi ,
I was given a procedure which expects one value and retrieves me the list of columns which may vary depending upon the input parameter
CREATE PROCEDURE [FLX].[GETANS]
@ques VARCHAR(200) AS
BEGIN
// some code that creates a temp table which has the dynamic cols
create table #temp1(
SELECT * FROM #temp1
END
When I execute this procedure from db2, it is fetching me the records. I would like to invoke this stored procedure from java. How can I retrieve the output columns of the procedure from java as the columns may vary some times.
Regards
Suresh Midde
|
 |
Santhosh ayiappan
Ranch Hand
Joined: Jan 30, 2007
Posts: 70
|
|
You can use the index of the column to get the records back. You dont need to depend on the column name.
|
 |
 |
|
|
subject: How to retrieve dynamic columns from stored procedure
|
|
|