Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id E516E475BDF for ; Sat, 23 Feb 2002 14:03:10 -0500 (EST) Received: from roberto by brasileiro.net with local (Exim 3.34 #1 (Debian)) id 16ehSF-0001Wz-00; Sat, 23 Feb 2002 12:03:31 -0700 Date: Sat, 23 Feb 2002 12:03:31 -0700 From: Roberto Mello To: Mark Nielsen Cc: pgsql-sql@postgresql.org Subject: Re: How do I return more than one value in a postgresql pl/pgsql procedure? Message-ID: <20020223190331.GA3786@cc.usu.edu> References: <3C768665.30500@kepnet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3C768665.30500@kepnet.net> User-Agent: Mutt/1.3.27i X-Archive-Number: 200202/340 X-Sequence-Number: 6762 On Fri, Feb 22, 2002 at 12:56:53PM -0500, Mark Nielsen wrote: > Hello! > > I am have been trying to figure out how I can get a pl/pgsql procedure > to return more than one variable or perhaps a row. A procedure you > create can accept more than one variable, I don't see why it shoudn't be > able to return more than one variable in some fashion.I read rumors that > pl/pgsql can return rows (which would contain one or more variables > per row), but I didn't find hard examples of how to do it. See this: http://developer.postgresql.org/docs/postgres/plpgsql-cursors.html Especially the section "Using Cursors". This is the 7.3devel documentation, but this section should work just as well for 7.2 (this WON'T work for 7.1 and below). > What table lists the stored procedures you created with pl/pgsql or > pl/perl? I was trying to find it with /dS in psql, but I didn't see > anything obvious. pg_proc -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 Dammit no! Don't pick on the pho^$ L%æ#!ø¯