From: Graham Vickrage <graham@digitalplanit.com>
To: hlefebvre <hlefebvre@lexbase.net>
To: pgsql-sql@postgresql.org
Subject: RE: Using SETOF in plpgsql function
Date: Wed, 23 Aug 2000 13:15:16 +0100
Message-ID: <NDBBJABDILOPAOOMFJHOKEAPCEAA.graham@digitalplanit.com> (raw)
In-Reply-To: <39A3A268.79F1BC27@lexbase.net>
As far as i know, you can only return single values from functions at the
moment.
Regards
Graham
-----Original Message-----
From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf
Of hlefebvre
Sent: 23 August 2000 11:08
To: pgsql-sql@postgresql.org
Subject: [SQL] Using SETOF in plpgsql function
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.
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: graham@digitalplanit.com, hlefebvre@lexbase.net
Subject: Re: Using SETOF in plpgsql function
In-Reply-To: <NDBBJABDILOPAOOMFJHOKEAPCEAA.graham@digitalplanit.com>
References: <39A3A268.79F1BC27@lexbase.net> <NDBBJABDILOPAOOMFJHOKEAPCEAA.graham@digitalplanit.com>
* 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