Skip site navigation (1) Skip section navigation (2)

Re: Question about refcursors

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Question about refcursors
Date: 2007-10-26 23:25:27
Message-ID: fftt17$3ah$1@ger.gmane.org (view raw or flat)
Thread:
Lists: pgsql-jdbc
Kris Jurka wrote on 27.10.2007 01:20:
>> Now after running the procedure (using execute()) I'm (generically) 
>> calling getResultSet() on the statement object. And indeed the driver 
>> does return a ResultSet, but it seems that the actual result of the 
>> call is "hidden" inside one of the columns of the resultset. If I do a 
>> getObject() on that resultset I get another result set which indeed is 
>> the result of my SELECT in the procedure.
>>
>> My question: is there a reason why the "real" result cannot be 
>> obtained using getResultSet() but is wrapped into another ResultSet?
>>
> 
> Consider what should be returned by:
> 
> SELECT 1, 'some text', func_returning_refcursor();
> 
> Or a function returning a refcursor as an out parameter.
> 
> Or a function returning a setof refcursor.
> 
> Just like you don't know exactly what you're executing, neither does the 
> driver.

Makes sense, didn't think about the SELECT usage, as I was thinking about a 
{call somefunc()} usage

Cheers
Thomas


In response to

Responses

pgsql-jdbc by date

Next:From: Robert WimmerDate: 2007-10-27 20:32:01
Subject: JPA and Postgresql
Previous:From: Kris JurkaDate: 2007-10-26 23:20:22
Subject: Re: Question about refcursors

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group