Re: function returning result set of varying column

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема Re: function returning result set of varying column
Дата
Msg-id 20080603171748.596b8a4c@dawn.webthatworks.it
обсуждение исходный текст
Ответ на Re: function returning result set of varying column  ("maria s" <psmg01@gmail.com>)
Список pgsql-sql
On Tue, 3 Jun 2008 10:06:45 -0400
"maria s" <psmg01@gmail.com> wrote:

> Hi Ivan,
> If I have to know the column names then I can't use the Functions.
> As I said before, the columns will vary. or As Pavel Stehule said
> I will use arrays.
> 
> Is anyone can show an example of returning a record with string
> and array?

What I meant was that with "pure" sql functions you shouldn't have
that constraint...

wrapping a select in a function

create or replace function fsql() as
$$
begin select * from mytable;
end;
$$ language sql;

should work.

SQL functions are less flexible than pg/plsql but maybe you can live
with it.
SQL functions still support conditionals etc... you'd have to see if
what SQL functions offer is enough for your need.

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



В списке pgsql-sql по дате отправления:

Предыдущее
От: "maria s"
Дата:
Сообщение: Re: function returning result set of varying column
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: function returning result set of varying column