Re: Returning multiple rows in 8.4

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Returning multiple rows in 8.4
Дата
Msg-id 20091110065948.GM5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Returning multiple rows in 8.4  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
On Mon, Nov 09, 2009 at 11:23:52PM +0000, Raymond O'Donnell wrote:
> On 09/11/2009 22:43, Raymond O'Donnell wrote:
> > Finally, you can use OUT parameters to return multiple values from the
> > function - this is handy if you need to return just a few values.
>
> Just to clarify further - this last option returns just a single row.

You can make it return several pretty easily:

  create function foo(out i text, out j text) returns setof record
      language plpgsql as $$
    begin
      i := 1; j := 2;
      return next;
      i := 2; j := 5;
      return next;
    end; $$;

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Editor for sgml files
Следующее
От: weixiang tam
Дата:
Сообщение: postgres 8.2.5 for Redhat linux