[GENERAL][SQL] Functions with composite resutl-set - Mailing list pgsql-general

From Herve Lefebvre
Subject [GENERAL][SQL] Functions with composite resutl-set
Date
Msg-id 19980721141935.24087.rocketmail@web2.rocketmail.com
Whole thread Raw
List pgsql-general
Hi all,

I've a function who retrieves multiple columns:

CREATE FUNCTION myfunc() RETURNS SETOF mytable
AS 'SELECT a,b,c FROM mytable;' LANGUAGE 'sql';

When I call it, I cannot retrieve all columns without
executing 3 times the function.

select myfunc() does not work

select a(myfunc()), b(myfunc()), c(myfunc()) works but executes 3
times the function.

I've tried
select *(mynfunc())
select all(myfunc())
select myfunc()::mytable
select myfunc()::mytable.*
...

But i've a syntax error on each of these.

Any help ? Thanks.

--
Herve LEFEBVRE




_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


pgsql-general by date:

Previous
From: Dan Delaney
Date:
Subject: [SQL] Can I store bitmap graphics in a table?
Next
From: Matt McClure
Date:
Subject: Re: [GENERAL] [SQL] Can I store bitmap graphics in a table?