pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hlefebvre <hlefebvre@lexbase.net>
To: pgsql-sql@postgresql.org
Subject: Using SETOF in plpgsql function
Date: Wed, 23 Aug 2000 12:07:36 +0200
Message-ID: <39A3A268.79F1BC27@lexbase.net> (raw)
References: <200008230946.e7N9kPT30420@hub.org>

Hello,

I'd like to return a set of integer in an pl/pgsql function. How can I
do that ?

I've tried things like that, put I've an error when executing :

CREATE FUNCTION SP_UPLES() RETURNS setof INTEGER AS '
    DECLARE ID INTEGER;
BEGIN
    select a into id from foo;
    return ID ;
END;      

CREATE FUNCTION SP_UPLES() RETURNS setof INTEGER AS '
    DECLARE ID setof INTEGER;
BEGIN
    select a into id from foo;
    return ID ;
END; 

CREATE FUNCTION SP_UPLES() RETURNS setof INTEGER AS '
BEGIN
    select a into id from foo;
    return select a from foo; 
END;           

Any help is welcomed.
Thanks.



view thread (8+ messages)  latest in thread

Message-ID: <39A3A268.79F1BC27@lexbase.net>
Permalink:  ../39A3A268.79F1BC27@lexbase.net/
Also on:    postgresql.org/message-id/39A3A268.79F1BC27@lexbase.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: hlefebvre@lexbase.net
  Subject: Re: Using SETOF in plpgsql function
  In-Reply-To: <39A3A268.79F1BC27@lexbase.net>
  References: <200008230946.e7N9kPT30420@hub.org> <39A3A268.79F1BC27@lexbase.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