Search Postgresql Archives

Re:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux