Re: Stored procedures/functions that can return recordsets... - Mailing list pgsql-jdbc

From Nic Ferrier
Subject Re: Stored procedures/functions that can return recordsets...
Date
Msg-id 87ptrtr74v.fsf@pooh-sticks-bridge.tapsellferrier.co.uk
Whole thread Raw
In response to Stored procedures/functions that can return recordsets...  ("Peter Adamek Jr." <peter.adamek@utoronto.ca>)
List pgsql-jdbc
"Peter Adamek Jr." <peter.adamek@utoronto.ca> writes:

> I am writing this to see if anyone has been able to successfully run a
> stored procedure (although it is probably still called a function) via
> Java (using a Callable Statement) and have it return a recordset (that
> is multiple columns and multiple rows).  If so, I would appreciate it if
> you could post a short example, both of the stored procedure and the
> Java code used to access it.

If you had checked the archives you could have established that this
has not been done yet: it is possible to return record sets to java
code, but not via a CallableStatement.

I have written a patch that allows PostgreSQL to do that.

I'll send it to you if you want.


> I have looked through the 7.3 documentation at the following link, but I
> have not found any references to this functionality.
>
> http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/
>
> I suspect that even in PostgreSQL version 7.3 no such thing as stored
> procedures exist - I suspect it was a misquote and the article is
> referring to functions.

Stored procedures, stored functions... all the same. The generic term
for imperative code executed within the database server is "stored
proc". PostgreSQL's implementation of stored procs can return only one
value.



Nic

pgsql-jdbc by date:

Previous
From: "Peter Adamek Jr."
Date:
Subject: Stored procedures/functions that can return recordsets...
Next
From: Kris Jurka
Date:
Subject: Re: updatable (J2EE) resultsets