Using SETOF in plpgsql function - Mailing list pgsql-sql

From hlefebvre
Subject Using SETOF in plpgsql function
Date
Msg-id 39A3A268.79F1BC27@lexbase.net
Whole thread Raw
Responses RE: Using SETOF in plpgsql function  ("Graham Vickrage" <graham@digitalplanit.com>)
Re: Using SETOF in plpgsql function  (Jan Wieck <janwieck@Yahoo.com>)
List pgsql-sql
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.


pgsql-sql by date:

Previous
From: Joerg Hessdoerfer
Date:
Subject: Re: Continuous inserts...
Next
From: Andreas Tille
Date:
Subject: Date of creation and of change