Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id B14BA47696B for ; Fri, 5 Jul 2002 13:51:16 -0400 (EDT) Mailbox-Line: From rmello@cc.usu.edu Fri Jul 5 13:51:16 2002 Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id B3168476A41 for ; Fri, 5 Jul 2002 12:21:12 -0400 (EDT) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 17QVpd-0003rY-00; Fri, 05 Jul 2002 10:21:17 -0600 Date: Fri, 5 Jul 2002 10:21:17 -0600 From: Roberto Mello To: teknokrat Cc: pgsql-sql@postgresql.org Subject: Re: How do i return a dataset from a stored procedure Message-ID: <20020705162117.GA14809@cc.usu.edu> References: <1cbae208.0207050032.4e052f07@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1cbae208.0207050032.4e052f07@posting.google.com> User-Agent: Mutt/1.3.28i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Spam-Status: No, hits=-2.9 required=5.0 tests=IN_REP_TO,TO_LOCALPART_EQ_REAL version=2.30 X-Spam-Level: X-Archive-Number: 200207/70 X-Sequence-Number: 8449 On Fri, Jul 05, 2002 at 01:32:33AM -0700, teknokrat wrote: > I can't figure out how to return a group of rows from a function > written in plpgsql (or plsql for that matter). The only way i have > seen it done is with a setof table return value in sql. But since the > query was a single select anyway i don't see the point of this. Is > there a way of creating a temporary table in a procedure and using it > as the output? Search the list archives (through groups.google.com - it's comp.databases.postgresql) or see the developer docs for PL/pgSQL. You can achive that effect by returning a cursor in PG 7.2 (the section on returning cursors is ommitted from the current docs in www.postgresql.org/idocs, so you need to look at the developer docs - see www.us.postgresql.org). -Roberto -- +----| http://fslc.usu.edu/ USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU - http://www.brasileiro.net/ http://www.sdl.usu.edu/ - Space Dynamics Lab, Developer Go straight to the docs. Do not pass GO. Do not collect $200!