pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chad Thompson <chad@weblinkservices.com>
To: mail.luckydigital.com <james.cooper@luckydigital.com>
To: pgsql-sql@postgresql.org
Subject: Re: 7.2 functions that return multiple result sets?
Date: Thu, 6 Feb 2003 12:28:30 -0700
Message-ID: <013801c2ce15$ef0ac250$32021aac@chad> (raw)
References: <01ac01c2cb04$6af0aa20$c900a8c0@jax>

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.

view thread (3+ messages)  latest in thread

Message-ID: <013801c2ce15$ef0ac250$32021aac@chad>
Permalink:  ../013801c2ce15$ef0ac250$32021aac@chad/
Also on:    postgresql.org/message-id/013801c2ce15$ef0ac250$32021aac@chad

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chad@weblinkservices.com, james.cooper@luckydigital.com
  Subject: Re: 7.2 functions that return multiple result sets?
  In-Reply-To: <013801c2ce15$ef0ac250$32021aac@chad>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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