Re:

From: Nigel Horne <njh(at)bandsman(dot)co(dot)uk>
To: Adam Witney <awitney(at)sgul(dot)ac(dot)uk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2005-08-19 15:38:20
Message-ID: 1124465900.4993.31.camel@laptop1.home-network2.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2005-08-19 at 16:30, Adam Witney wrote:
> > I can't work out from that how to return more than one value.
>
> Hi Nigel,
>
> Add SETOF to your function like so:
>
> CREATE TABLE test (id int);
> INSERT INTO test VALUES(1);
> INSERT INTO test VALUES(2);
>
> CREATE FUNCTION test_func() RETURNS SETOF integer AS '
> SELECT id FROM test;
> ' LANGUAGE SQL;

What if one value I want to return is an integer, and another one is a
string?

> Cheers
>
> Adam

-Nigel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Witney 2005-08-19 15:41:40 Re: http://www.postgresql.org/docs/8.0/static/xfunc-sql.html
Previous Message Nigel Horne 2005-08-19 15:36:26 Re: