David Fetter <da...@fetter.org> wrote:
 
> Would something like this do?  Thanks to Andrew Gierth for helping
> me figure out how to get this working :)
> 
> CREATE OR REPLACE FUNCTION multi_result()
> RETURNS SETOF REFCURSOR
 
With appropriate tweaks to JDBC and the other drivers, this would
cover a lot of ground.  You might be able to cover the last little
bit by returning a SETOF some record with (at least) three columns,
one of which would be filled in each row: REFCURSOR (for a result
set), INTEGER (for a row count), and something which could carry an
object which would map to a SQLWarning (which can be used with
SQLSTATE '00000' to deliver informational text or '01xxx' for actual
warnings).  A JDBC execute request (as opposed to executeUpdate or
executeQuery) may get back any combination of the above in an
ordered fashion.  Essentially, this meta result set would need to be
hidden within the Statement object.
 
http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/sql/Statement.html#execute%28java.lang.String%29
 
http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/sql/Statement.html#getWarnings%28%29
 
-Kevin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to