Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1666347611A for ; Tue, 1 Oct 2002 15:01:33 -0400 (EDT) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id 5DAAE4760E4 for ; Tue, 1 Oct 2002 15:01:32 -0400 (EDT) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 17wSNh-0001QU-00 for ; Tue, 01 Oct 2002 13:08:29 -0600 Date: Tue, 1 Oct 2002 13:08:13 -0600 From: Roberto Mello To: bcschnei@attbi.com Subject: Re: Stored Procedures Message-ID: <20021001190813.GB5383@cc.usu.edu> References: <20021001181701.QWQH9928.rwcrmhc52.attbi.com@rwcrwbc57> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20021001181701.QWQH9928.rwcrmhc52.attbi.com@rwcrwbc57> User-Agent: Mutt/1.4i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. Resent-From: rmello@cc.usu.edu Resent-Date: Tue, 1 Oct 2002 13:08:29 -0600 Resent-To: pgsql-sql@postgresql.org Resent-Message-Id: Resent-Sender: Roberto Mello X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/8 X-Sequence-Number: 9726 On Tue, Oct 01, 2002 at 06:16:57PM +0000, bcschnei@attbi.com wrote: > Hi all. I'm looking for a little help here. I have a > project where I have to write some stored proceedures > and am having some problems. My main issue is, I cannot > figure out how to return a record set containing > multipule columns. I am looking for a few examples on > how I can do this. Most of what I have to do is fairly > simple SQL queries based on a pramater sent to the > function. I tried to use the SETOF option, > but only get back one column. In 7.2 this is acomplished through returning a cursor from the function. See the 7.3 documentation to see how to do that (AFAIK, this is not documented in the 7.2 docs, although it does work). In 7.3 you can return true record sets without the use of cursors. Again, see the docs for 7.3 in the developers site. -Roberto -- +----| Roberto Mello - http://www.brasileiro.net/ |------+ + Computer Science Graduate Student, Utah State University + + USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ + Q: How many IBM CPU's does it take to do a logical right shift? A: 33. 1 to hold the bits and 32 to push the register.