db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: resultsets from stored procedures?
Date Mon, 31 Mar 2008 13:25:51 GMT
Stanley Bradbury wrote:
> David Parker wrote:
>> I would like to be able to create a java stored procedure that 
>> returns a ResultSet. Ideally, I would be able to call this as a 
>> function from within an SQL statement.
>>
>> The application requires that given a parent-child relationship where 
>> a given row can have a chain of ancestors, we need to be able to get 
>> all of the ancestor ids as a flat list, or row set. In Oracle I am 
>> using a CONNECT BY for this operation. (Has anybody thought about 
>> implementing that in Derby?).
>>
>> Any pointers to doc on how to return a resultset from a procedure 
>> would be much appreciated, as would any comments, suggestions, 
>> warnings, dire predictions, etc....
>>
>> Thanks.
>>
>> - DAP
>> ===========================================
>> David Parker
>> david@smallsolid.com
>> (401) 263-1782
>>
>>
>>
>>
>>
> I regularly refer to this article on the WIKI.  There is an example at 
> the bottom that returns a resultSet
>
> http://wiki.apache.org/db-derby/DerbySQLroutines
>
> I don't know about returning a resultSet to a function but it can be 
> done with a procedure.
Hi David,

If you need to return the ResultSet from a function (and join it to 
other tables in a query), you may be interested in the Table Function 
feature which is being beta-tested as part of the upcoming 10.4 release. 
This feature is described by the functional spec attached to DERBY-716 
and by the "Programming Derby-style table functions" section of the 
Derby Developer's Guide: http://db.apache.org/derby/docs/dev/devguide/

Hope this helps,
-Rick

Mime
View raw message