SETOF modifier

From: Jason Davis <jdavis(at)tassie(dot)net(dot)au>
To: pgsql-novice(at)postgresql(dot)org
Subject: SETOF modifier
Date: 2000-10-16 04:04:35
Message-ID: 200010160404.PAA19463@zeus.tassie.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all

I have been trying to create a basic SQL function which returns a SETOF
values, without much luck. The docs make plenty of mention of the fact you
can return multiple values from a function, but unfortunately don't give
any examples as such. The syntax I thought would work is along the lines of

CREATE FUNCTION sp_testing() RETURNS setof text AS '
SELECT col1, col2, col3 FROM table;
' LANGUAGE 'sql';

I'd much appreciate anyone's help who has encountered this one before or
who knows the syntax!

regards
Jason Davis
DB Administrator/Programmer
www.tassie.net.au

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2000-10-16 04:39:48 Re: SETOF modifier
Previous Message Webb Sprague 2000-10-16 02:07:52 Syslog and Postgres