SETOF modifier

Jason Davis <jdavis@tassie.net.au>

From: Jason Davis <jdavis@tassie.net.au>
To: pgsql-novice@postgresql.org
Date: 2000-10-16T04:04:35Z
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