pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roberto Mello <rmello@cc.usu.edu>
To: teknokrat <teknokrat@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How do i return a dataset from a stored procedure
Date: Fri, 5 Jul 2002 10:21:17 -0600
Message-ID: <20020705162117.GA14809@cc.usu.edu> (raw)
In-Reply-To: <1cbae208.0207050032.4e052f07@posting.google.com>
References: <1cbae208.0207050032.4e052f07@posting.google.com>

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!





view thread (4+ messages)  latest in thread

Message-ID: <20020705162117.GA14809@cc.usu.edu>
Permalink:  ../20020705162117.GA14809@cc.usu.edu/
Also on:    postgresql.org/message-id/20020705162117.GA14809@cc.usu.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rmello@cc.usu.edu, teknokrat@yahoo.com
  Subject: Re: How do i return a dataset from a stored procedure
  In-Reply-To: <20020705162117.GA14809@cc.usu.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox