Multiple resultsets from Oracle in Odp.net,without refcursors

Posted by James L on Stack Overflow See other posts from Stack Overflow or by James L
Published on 2010-03-23T10:35:42Z Indexed on 2010/03/24 23:23 UTC
Read the original article Hit count: 206

Filed under:
|

SQL Server is able to return the results of multiple queries in a single round-trip, e.g:

select a, b, c from y;
select d, e, f from z;

Oracle doesn't like this syntax. It is possible to use reference cursors, like this:

begin 
  open :1 for select count(*) from a; 
  open :2 for select count(*) from b; 
end; 

However, you incur a penalty in opening/closing cursors and you can hold database locks for an extended period. What I'd like to do is retrieve the results for these two queries in one shot, using Odp.net. Is it possible?

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about odp.net