Re: Multiple Resultsets

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Multiple Resultsets
Дата
Msg-id 3F098ED6.3040101@joeconway.com
обсуждение исходный текст
Ответ на Re: Multiple Resultsets  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-novice
Bruno Wolff III wrote:
> On Mon, Jul 07, 2003 at 10:04:26 -0400,
>   Michael Guerin <guerin@rentec.com> wrote:
>
>>Does anyone know if PostgreSQL can support functions that return
>>multiple results sets like SQL Server stored procedures.
>
> Yes it can. I think you want to use at least 7.3 for that feature.
> My memory is that there was something you could do in 7.2, but that
> it doesn't work nearly as well as what is available for 7.3.
>

Um, except for the *multiple* part. MS SQL Server allows a stored
procedure call like this:

   exec sp_my_stored_procedure

and that will "project" one or more results sets to the front end. Those
results cannot be qualified or joined with other data.

In Postgres 7.3 (and up) you can create a "table function" which is a
function that can be used in the FROM clause, just like a table. It can
be qualified and joined with other FROM clause sources; e.g.:

   select * from my_table_function();

However, it cannot return multiple results sets.

HTH,

joe


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

Предыдущее
От: Volker Krey
Дата:
Сообщение: inheritance
Следующее
От: Brad Rhine
Дата:
Сообщение: Groups and Users