From tlqmail@yahoo.com Mon Feb 17 20:07:14 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 17636475B99 for ; Mon, 17 Feb 2003 15:07:14 -0500 (EST) Received: from web14809.mail.yahoo.com (web14809.mail.yahoo.com [216.136.224.230]) by postgresql.org (Postfix) with SMTP id 56967475B8F for ; Mon, 17 Feb 2003 15:07:13 -0500 (EST) Message-ID: <20030217200713.84465.qmail@web14809.mail.yahoo.com> Received: from [66.139.15.154] by web14809.mail.yahoo.com via HTTP; Mon, 17 Feb 2003 12:07:13 PST Date: Mon, 17 Feb 2003 12:07:13 -0800 (PST) From: Mintoo Lall Subject: Returning multiple rows from plpgsql function To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-595128334-1045512433=:83066" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/384 X-Sequence-Number: 11782 --0-595128334-1045512433=:83066 Content-Type: text/plain; charset=us-ascii Hi Everybody, How can I return multiple rows from a plpqsql function. I wanted to write a function which gives me the result of the final select query from a bunch of nested select queries. What return type should use? The return type %ROWTYPE only returns a single row. In SQL function I can do this by stating that the function returns a setof record but it doesnt work in plpgsql function. Thanks, Tarun --------------------------------- Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day --0-595128334-1045512433=:83066 Content-Type: text/html; charset=us-ascii

Hi Everybody,

How can I return multiple rows from a plpqsql function. I wanted to write a function which gives me the result of the final select query from a bunch of nested select queries. What return type should use? The return type %ROWTYPE only returns a single row. In SQL function I can do this by stating that the function returns a setof record but it doesnt work in plpgsql function.

Thanks,

Tarun



Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day --0-595128334-1045512433=:83066-- From sszabo@megazone23.bigpanda.com Mon Feb 17 20:18:20 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 77753474E53 for ; Mon, 17 Feb 2003 15:18:20 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 08179474E42 for ; Mon, 17 Feb 2003 15:18:20 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 8B682D5F7; Mon, 17 Feb 2003 12:18:20 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 80EA95C03; Mon, 17 Feb 2003 12:18:20 -0800 (PST) Date: Mon, 17 Feb 2003 12:18:20 -0800 (PST) From: Stephan Szabo To: Mintoo Lall Cc: Subject: Re: Returning multiple rows from plpgsql function In-Reply-To: <20030217200713.84465.qmail@web14809.mail.yahoo.com> Message-ID: <20030217121738.F9891-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/385 X-Sequence-Number: 11783 On Mon, 17 Feb 2003, Mintoo Lall wrote: > How can I return multiple rows from a plpqsql function. I wanted to > write a function which gives me the result of the final select query > from a bunch of nested select queries. What return type should use? > The return type %ROWTYPE only returns a single row. In SQL function I > can do this by stating that the function returns a setof record but it > doesnt work in plpgsql function. You might want to look at the Set Returning Functions document at techdocs.postgresql.org.