Re: is it possible to recover more than one recordset or cursor from a function?

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
Cc: guillermoariast(at)linuxwaves(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: is it possible to recover more than one recordset or cursor from a function?
Date: 2007-06-18 07:31:21
Message-ID: 162867790706180031o687cafebw781f1f74e27c9d05@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2007/6/18, Albe Laurenz <all(at)adv(dot)magwien(dot)gv(dot)at>:
> guillermo arias wrote:
> >
> > is it possible to recover more than one recordset or cursor
> > from a function?
> > I use to do it in ms sql server, but it is a mistery for me
> > in postgre.
>
> CREATE FUNCTION returns2cursors(OUT c1 refcursor, OUT c2 refcursor)
> LANGUAGE plpgsql AS ....
>

or CREATE FUNCTION ... RETURNS SETOF CURSOR
BEGIN
...
END

you can find notice about it in documentation
http://www.postgresql.org/docs/8.2/interactive/plpgsql-cursors.html

regards
Pavel Stehule

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2007-06-18 08:00:37 Re: Problem editing tables (geom columns)
Previous Message Albe Laurenz 2007-06-18 07:22:35 Re: is it possible to recover more than one recordset or cursor from a function?