RE: Using SETOF in plpgsql function

From: "Graham Vickrage" <graham(at)digitalplanit(dot)com>
To: "hlefebvre" <hlefebvre(at)lexbase(dot)net>, <pgsql-sql(at)postgresql(dot)org>
Subject: RE: Using SETOF in plpgsql function
Date: 2000-08-23 12:15:16
Message-ID: NDBBJABDILOPAOOMFJHOKEAPCEAA.graham@digitalplanit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

As far as i know, you can only return single values from functions at the
moment.

Regards

Graham

-----Original Message-----
From: pgsql-sql-owner(at)hub(dot)org [mailto:pgsql-sql-owner(at)hub(dot)org]On Behalf
Of hlefebvre
Sent: 23 August 2000 11:08
To: pgsql-sql(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message hlefebvre 2000-08-23 12:35:31 Re: Using SETOF in plpgsql function
Previous Message Graham Vickrage 2000-08-23 12:07:31 RE: Null function parameters