Re: 7.2 functions that return multiple result sets?

From: "Chad Thompson" <chad(at)weblinkservices(dot)com>
To: "mail(dot)luckydigital(dot)com" <james(dot)cooper(at)luckydigital(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: 7.2 functions that return multiple result sets?
Date: 2003-02-06 19:28:30
Message-ID: 013801c2ce15$ef0ac250$32021aac@chad
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Found this using google
from http://archives.postgresql.org/pgsql-sql/2002-01/msg00312.php

Depending on what you're doing (and if you're willing to work with the
7.2rcs or wait for it), 7.2 allows you to define functions that return
cursors that you can then fetch from within the transaction you called the
function in, so you should be able to do a sequence like:

begin;
select * from func(param);
-- get back name of cursor, say "<unnamed cursor 1>" --
fetch 10 from "<unnamed cursor 1>";
fetch 10 from "<unnamed cursor 1>";
close "<unnamed cursor 1>";
commit;

Seems 7.2 is limited to cursors, where 7.3 will do recordsets (and upgrading is SO easy)

HTH
Chad
----- Original Message -----
From: mail.luckydigital.com
To: pgsql-sql(at)postgresql(dot)org
Sent: Sunday, February 02, 2003 2:45 PM
Subject: [SQL] 7.2 functions that return multiple result sets?

Can some one please confirm( with a plpgsql function example please ) a postgres "7.2" function that can return multiple rows to the client.

I've gone through the docs and can't find anything to support this -it seems you can only have one return value or null.

Yes i'm aware this it is possible in 7.3 - can someone please confirm its not possible in 7.2 or provide me with an example of how to go about it.

Thank you.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-02-06 20:19:13 Re: changing referential integrety action on existing table
Previous Message Roberto Mello 2003-02-06 19:27:43 Re: get # of rows while doing SELECT with LIMIT at same time ?