pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
7.2 functions that return multiple result sets?
3+ messages / 3 participants
[nested] [flat]

* 7.2 functions that return multiple result sets?
@ 2003-02-02 21:45  mail.luckydigital.com <james.cooper@luckydigital.com>
  0 siblings, 2 replies; 3+ messages in thread

From: mail.luckydigital.com @ 2003-02-02 21:45 UTC (permalink / raw)
  To: pgsql-sql

Can some one please confirm( with a plpgsql function example please ) a postgres "7.2" function that can return multiple rows to the client.

I've gone through the docs and can't find anything to support this -it seems you can only have one return value or null. 

Yes i'm aware this it is possible in 7.3 - can someone please confirm its not possible in 7.2 or provide me with an example of how to go about it.


Thank you.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: 7.2 functions that return multiple result sets?
@ 2003-02-06 19:28  Chad Thompson <chad@weblinkservices.com>
  parent: mail.luckydigital.com <james.cooper@luckydigital.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Chad Thompson @ 2003-02-06 19:28 UTC (permalink / raw)
  To: mail.luckydigital.com <james.cooper@luckydigital.com>; pgsql-sql

Found this using google
from http://archives.postgresql.org/pgsql-sql/2002-01/msg00312.php

Depending on what you're doing (and if you're willing to work with the
7.2rcs or wait for it), 7.2 allows you to define functions that return
cursors that you can then fetch from within the transaction you called the
function in, so you should be able to do a sequence like:

begin;
select * from func(param);
-- get back name of cursor, say "<unnamed cursor 1>" --
fetch 10 from "<unnamed cursor 1>";
fetch 10 from "<unnamed cursor 1>";
close "<unnamed cursor 1>";
commit;

Seems 7.2 is limited to cursors, where 7.3 will do recordsets (and upgrading is SO easy)

HTH
Chad
  ----- Original Message ----- 
  From: mail.luckydigital.com 
  To: pgsql-sql@postgresql.org 
  Sent: Sunday, February 02, 2003 2:45 PM
  Subject: [SQL] 7.2 functions that return multiple result sets?


  Can some one please confirm( with a plpgsql function example please ) a postgres "7.2" function that can return multiple rows to the client.

  I've gone through the docs and can't find anything to support this -it seems you can only have one return value or null. 

  Yes i'm aware this it is possible in 7.3 - can someone please confirm its not possible in 7.2 or provide me with an example of how to go about it.


  Thank you.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: 7.2 functions that return multiple result sets?
@ 2003-02-06 22:53  Ian Barwick <barwick@gmx.net>
  parent: mail.luckydigital.com <james.cooper@luckydigital.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Ian Barwick @ 2003-02-06 22:53 UTC (permalink / raw)
  To: mail.luckydigital.com <james.cooper@luckydigital.com>; pgsql-sql

On Sunday 02 February 2003 22:45, mail.luckydigital.com wrote:
> Can some one please confirm( with a plpgsql function example please ) a
> postgres "7.2" function that can return multiple rows to the client.
>
> I've gone through the docs and can't find anything to support this -it
> seems you can only have one return value or null.
>
> Yes i'm aware this it is possible in 7.3 - can someone please confirm its
> not possible in 7.2 or provide me with an example of how to go about it.

IIRC this is a new feature in 7.3, see:

http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=release.html

"Allow functions to return multiple rows (table functions) (Joe)"

Ian Barwick
barwick@gmx.net




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-02-06 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-02 21:45 7.2 functions that return multiple result sets? mail.luckydigital.com <james.cooper@luckydigital.com>
2003-02-06 19:28 ` Chad Thompson <chad@weblinkservices.com>
2003-02-06 22:53 ` Ian Barwick <barwick@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox