Re: Functions returning multiple rowsets

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Functions returning multiple rowsets
Дата
Msg-id 162867790909281029v967ed09geaa202041c58a79@mail.gmail.com
обсуждение исходный текст
Ответ на Functions returning multiple rowsets  (Thom Brown <thombrown@gmail.com>)
Список pgsql-general
Hello

2009/9/28 Thom Brown <thombrown@gmail.com>:
> Hi,
>
> Is it possible to create a function using 'SQL' as language which could
> return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM
> TABLE2;" where both results are returned in the output?  I know this can be
> done in stored procedures in other RBDMS but can this be done in a function?
>

it is possible, but not directly. You can returns setof refcursors

see http://www.postgresql.org/docs/8.2/static/plpgsql-cursors.html

regards
Pavel Stehule

> Thanks
>
> Thom
>

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: sync structures
Следующее
От: Reid Thompson
Дата:
Сообщение: Re: computed values in plpgsql