You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by "John C. Turnbull" <oz...@ozemail.com.au> on 2007/08/01 03:08:13 UTC

Returning multiple rows from a procedure call

I am a bit confused... I would like to have a procedure "return" multiple
rows but I can't see any way to achieve this as the only methods available
to process out parameters do not allow the specification of a row number.
So is it possible to have a Java method that invokes a procedure and then
process the multiple rows it generates?  If so how?

 

Thanks,

 

John C. Turnbull

 


RE: Returning multiple rows from a procedure call

Posted by "John C. Turnbull" <oz...@ozemail.com.au>.
Thank you Daniel - that works perfectly.

John

> -----Original Message-----
> From: Daniel John Debrunner [mailto:djd@apache.org]
> Sent: Thursday, 2 August 2007 00:04
> To: Derby Discussion
> Subject: Re: Returning multiple rows from a procedure call
> 
> John C. Turnbull wrote:
> 
> >
> > Can anyone help me fetch multiple rows from a procedure call?
> 
> You can return JDBC one or more JDBC ResultSet's from a procedure.
> See this wiki page
> 
> http://wiki.apache.org/db-derby/DerbySQLroutines
> 
> HTH,
> Dan.

Re: Returning multiple rows from a procedure call

Posted by Daniel John Debrunner <dj...@apache.org>.
John C. Turnbull wrote:

> 
> Can anyone help me fetch multiple rows from a procedure call?

You can return JDBC one or more JDBC ResultSet's from a procedure.
See this wiki page

http://wiki.apache.org/db-derby/DerbySQLroutines

HTH,
Dan.

RE: Returning multiple rows from a procedure call

Posted by "John C. Turnbull" <oz...@ozemail.com.au>.
Further to this, I have looked at the method getArray() but it generates a
not supported exception.  I have also looked at using the JDBC type
JAVA_OBJECT and then using it as an array but I am unable to get past syntax
errors when declaring the procedure with an OUT parameter of that type - it
just doesn't seem to recognise JAVA_OBJECT or OTHER which I found in the
Derby reference manual.

 

Can anyone help me fetch multiple rows from a procedure call?

 

Thanks,

 

John

 

From: John C. Turnbull [mailto:ozemale@ozemail.com.au] 
Sent: Wednesday, 1 August 2007 11:08
To: 'Derby Discussion'
Subject: Returning multiple rows from a procedure call

 

I am a bit confused... I would like to have a procedure "return" multiple
rows but I can't see any way to achieve this as the only methods available
to process out parameters do not allow the specification of a row number.
So is it possible to have a Java method that invokes a procedure and then
process the multiple rows it generates?  If so how?

 

Thanks,

 

John C. Turnbull