X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 64D5DCD085 for ; Sun, 20 Jul 2003 06:19:35 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 00333-10 for ; Sun, 20 Jul 2003 06:20:06 +0000 (GMT) Received: from megazone.bigpanda.com (unknown [66.180.233.26]) by svr1.postgresql.org (Postfix) with ESMTP id 966F9CD08F for ; Sun, 20 Jul 2003 03:19:29 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 979E6D620; Sat, 19 Jul 2003 23:20:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 60E8C5C13; Sat, 19 Jul 2003 23:20:01 -0700 (PDT) Date: Sat, 19 Jul 2003 23:20:00 -0700 (PDT) From: Stephan Szabo To: Derrick Betts Cc: Subject: Re: Return a set of values from postgres Function In-Reply-To: <00b301c34cb5$346b1390$0100a8c0@BigOne> Message-ID: <20030719231726.S55138-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/296 X-Sequence-Number: 14410 On Thu, 17 Jul 2003, Derrick Betts wrote: > I want to get a set of values returned from a function. The values > (there will need to be four of them) come from 4 separate SELECT > statements inside the Function. For example SELECT one INTO variable1 > from table1 where ... then SELECT two INTO variable2 from table1 > where... At first you might think I could just combine the select > statements into one statement, but I can't. I need to pass the > results of each separate select statement into distinct variables and > return them together to the application. I'd suggest reading one of the items on the set returning functions: http://www.varlena.com/GeneralBits/26.html http://techdocs.postgresql.org/guides/SetReturningFunctions