X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C3F9C475AAC for ; Thu, 6 Feb 2003 14:31:29 -0500 (EST) Received: from utahisp.com (pop3.utahisp.com [66.239.12.3]) by postgresql.org (Postfix) with ESMTP id 32B07475A45 for ; Thu, 6 Feb 2003 14:31:25 -0500 (EST) Received: from chad [63.230.8.76] by utahisp.com (SMTPD32-7.13) id A7CC3677028A; Thu, 06 Feb 2003 12:30:20 -0700 Message-ID: <013801c2ce15$ef0ac250$32021aac@chad> From: "Chad Thompson" To: "mail.luckydigital.com" , References: <01ac01c2cb04$6af0aa20$c900a8c0@jax> Subject: Re: 7.2 functions that return multiple result sets? Date: Thu, 6 Feb 2003 12:28:30 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0135_01C2CDDB.41D78350" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Declude-Sender: chad@weblinkservices.com [63.230.8.76] X-Note: This E-mail was scanned by Declude JunkMail (www.declude.com) for spam. X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/131 X-Sequence-Number: 11529 This is a multi-part message in MIME format. ------=_NextPart_000_0135_01C2CDDB.41D78350 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 "" -- fetch 10 from ""; fetch 10 from ""; close ""; commit; Seems 7.2 is limited to cursors, where 7.3 will do recordsets (and upgradin= g is SO easy) HTH Chad ----- Original Message -----=20 From: mail.luckydigital.com=20 To: pgsql-sql@postgresql.org=20 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 p= ostgres "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 se= ems you can only have one return value or null.=20 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. ------=_NextPart_000_0135_01C2CDDB.41D78350 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
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=20 the
7.2rcs or wait for it), 7.2 allows you to define functions that=20 return
cursors that you can then fetch from within the transaction you c= alled=20 the
function in, so you should be able to do a sequence=20 like:

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

Seems 7.2 is l= imited to=20 cursors, where 7.3 will do recordsets (and upgrading is SO easy)
 
HTH
Chad
----- Original Message -----
Fro= m:=20 mail.luckydigital.com <= /DIV>
To: pgsql-sql@postgresql.org
Sent: Sunday, February 02, 2003 2:= 45=20 PM
Subject: [SQL] 7.2 functions that = return=20 multiple result sets?

Can some one please confirm( with a plpg= sql=20 function example please ) a postgres "7.2" function that can return multi= ple=20 rows to the client.
 
I've gone through the docs and can't fin= d=20 anything to support this -it seems you can only have one return value or = null.=20
 
Yes i'm aware this it is possible in 7.3= - can=20 someone please confirm its not possible in 7.2 or provide me with an exam= ple=20 of how to go about it.
 
 
Thank you.
------=_NextPart_000_0135_01C2CDDB.41D78350--