Nigel Horne <[EMAIL PROTECTED]> writes:
> It strikes me that there are two problems with this approach:
> 1) It stores the return values in the database, that seems a waste
> 2) It's slightly more complicated in that I have to delete the
> return values from the previous call before inserting the
On 22/8/05 10:19 am, "Nigel Horne" <[EMAIL PROTECTED]> wrote:
> On Fri, 2005-08-19 at 17:29, Tom Lane wrote:
>> Adam Witney <[EMAIL PROTECTED]> writes:
>>> Ah you want to return a record I suppose?
>>
>>> CREATE TABLE test (id int, name text);
>>> INSERT INTO test VALUES(1, 'me');
>>> INSERT INTO
Adam Witney <[EMAIL PROTECTED]> writes:
> Ah you want to return a record I suppose?
> CREATE TABLE test (id int, name text);
> INSERT INTO test VALUES(1, 'me');
> INSERT INTO test VALUES(2, 'you');
> CREATE FUNCTION test_func() RETURNS SETOF record AS '
> SELECT id, name FROM test;
> ' LANG
On 19/8/05 4:38 pm, "Nigel Horne" <[EMAIL PROTECTED]> wrote:
> 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
> 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;
SE
am 19.08.2005, um 15:58:20 +0100 mailte Nigel Horne folgendes:
> I can't work out from that how to return more than one value.
17:35 < rtfm_please> For information about srf
17:35 < rtfm_please> see
http://techdocs.postgresql.org/guides/SetReturningFunctions
17:35 < rtfm_please> or
http://www.p