Received: from digitalplanit.wdi.co.uk ([195.13.87.250]) by hub.org (8.10.1/8.10.1) with ESMTP id e7NCHbT72885 for ; Wed, 23 Aug 2000 08:17:38 -0400 (EDT) Received: from Graham (th-access1-6.gw.cerbernet.net [195.13.86.6]) by digitalplanit.wdi.co.uk (8.9.3/8.9.3) with SMTP id NAA12794; Wed, 23 Aug 2000 13:21:55 GMT From: "Graham Vickrage" To: "hlefebvre" , Subject: RE: Using SETOF in plpgsql function Date: Wed, 23 Aug 2000 13:15:16 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-reply-to: <39A3A268.79F1BC27@lexbase.net> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200008/239 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.