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

Started by guillermo ariasalmost 19 years ago4 messagesgeneral
Jump to latest
#1guillermo arias
guillermoariast@linuxwaves.com

<DIV style="font-family:Arial, sans-serif; font-size:10pt;"><FONT size="2"><SPAN style="font-family: Arial,sans-serif;">Hello, people, i have a question for you:<BR>is it possible to recover more than one recordset or cursor from a function?<BR>I use to do it in ms sql server, but it is a mistery for me in postgre.<BR><BR>Thanks<BR></SPAN></FONT><BR>&nbsp;<BR><HR>Get your FREE, LinuxWaves.com Email Now! --&gt; http://www.LinuxWaves.com&lt;BR&gt;Join Linux Discussions! --&gt; http://Community.LinuxWaves.com&lt;/DIV&gt;

#2Steve Crawford
scrawford@pinpointresearch.com
In reply to: guillermo arias (#1)
Re: is it possible to recover more than one recordset or cursor from a function?

guillermo arias wrote:

Hello, people, i have a question for you:
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.

Start here:
http://www.postgresql.org/docs/8.2/static/xfunc-sql.html#AEN36437

Cheers,
Steve

#3Albe Laurenz
all@adv.magwien.gv.at
In reply to: guillermo arias (#1)
Re: is it possible to recover more than one recordset or cursor from a function?

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 ....

Yours,
Laurenz Albe

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Albe Laurenz (#3)
Re: is it possible to recover more than one recordset or cursor from a function?

2007/6/18, Albe Laurenz <all@adv.magwien.gv.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