Hi Magnus,

Yes, this is the situation that I have been thinking about. Specifically
when a single stored procedure returns many recordsets.

Perhaps I should also clarify that the "spec" I have been using is
the JDK javadoc documentation.

Using java with Magnus' procedure:
CallableStatement cs = connection.prepareCall("call get_info_for_user ?");
cs.setString(1, "test");
if(cs.execute()) {
ResultSet rs = cs.getResultSet();
while(rs != null) {
// Process rs


Magnus Hagander wrote:
Not a user of JDBC, but this is fairly common in the ADO/ADO.NET world
with MS SQL Server as well (not sure about other dbs and .NET - I'ev
only used it with mssql and pgsql)... As for an example, something along
the line of (though in my cases usually with a *lot* more parameters):

CREATE PROCEDURE get_info_for_user(@userid varchar(16)) AS
SELECT something FROM contentstable WHERE userid=@userid

SELECT whatever,somethingelse FROM anothertable WHERE

You get the point :-)
Then in my .net code I'd do a simple:
SqlDataReader rdr = cmd.ExecuteReader();
... process first result ...
... process second result...

Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2022 Grokbase