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

Regards

Graham

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of hlefebvre
Sent: 23 August 2000 11:08
To: [EMAIL PROTECTED]
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 via email to