the_7th_king
asked on
Accessing temp table result set through JDBC
Hello,
I have written a procedure in MS SQL. In this procedure, I've created a temp table and put data inside this table.
I do a select * from this temp table and then drop the table.
Now, I want to access this result set in JDBC, but it gives me an error "Statement does not return any result set". If I run the procedure from within SQL itself, the result set comes up fine.
Please suggest.
I have written a procedure in MS SQL. In this procedure, I've created a temp table and put data inside this table.
I do a select * from this temp table and then drop the table.
Now, I want to access this result set in JDBC, but it gives me an error "Statement does not return any result set". If I run the procedure from within SQL itself, the result set comes up fine.
Please suggest.
ASKER
Even if I stop manually dropping the temp tables, the result set still cannot be displayed in JDBC
Well, it's 12 years since I used JDBC, and it had some wild bugs then! Anyhow, check this out. There's an answer from a guy who upgraded from SS2000 to SS2005 and it stopped giving him back an answer maybe that'll help you!
hth
Mike
hth
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have written a procedure in MS SQL. In this procedure, I've created a temp table and put data inside this table.
Post your code.
Post your code.
ASKER
putting a "NO COUNT" did the trick!
thanks a lot!
thanks a lot!
You might also look at using Table Vars instead of temp tables - they go away automagically after you leave the proc.
If you still don't get any results according to JDBC then please post your code.