pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <janwieck@yahoo.com>
To: Otis Gospodnetic <otisg@ivillage.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: PLPGSQL func. defn. for returning resultset?
Date: Mon, 25 Feb 2002 14:09:28 -0500 (EST)
Message-ID: <200202251909.g1PJ9SA01207@saturn.janwieck.net> (raw)
In-Reply-To: <3C794AAE.3080405@ivillage.com>

Otis Gospodnetic wrote:
> Hello,
>
> I need to write some functions/stored procedures in PLPGSQL.
> All examples have a return clause that returns a single item (e.g.
> RETURN INTEGER or RETURN VARCHAR, etc.).
>
> However, I need to return a result set (e.g. SELECT user_id, name FROM
> users).  What do I specify in the return part of the FUNCTION definition
> for that?
> CREATE FUNCTION foo() RETURNS ????? AS ' .....
> What do I put in place of ?????
>
> I could not find any examples for such cases.

    And it would really surprise me if you could find examples of
    that.  The only way you currently can  return  a  result  set
    would be through a cursor, opened in your function.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




view thread (3+ messages)

Message-ID: <200202251909.g1PJ9SA01207@saturn.janwieck.net>
Permalink:  ../200202251909.g1PJ9SA01207@saturn.janwieck.net/
Also on:    postgresql.org/message-id/200202251909.g1PJ9SA01207@saturn.janwieck.net

 · 

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: janwieck@yahoo.com, otisg@ivillage.com
  Subject: Re: PLPGSQL func. defn. for returning resultset?
  In-Reply-To: <200202251909.g1PJ9SA01207@saturn.janwieck.net>

* 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