Re: Using Cursor in PostgreSQL 7.2 - Mailing list pgsql-general

From Holger Krug
Subject Re: Using Cursor in PostgreSQL 7.2
Date
Msg-id 20011207083047.A689@dev12.rationalizer.com
Whole thread Raw
In response to Re: [BASIC FEATURES] stored procedures in Postgresql ?  (Doug McNaught <doug@wireboard.com>)
List pgsql-general
On Thu, Dec 06, 2001 at 01:13:18PM -0500, Doug McNaught wrote:
> However, it's my understanding that in 7.2 (which is currently in
> beta) functions can return open cursors, which gives you a lot of the
> same functionality as returning result sets.

Gives it also the possibility to returning result sets to the client ??

I want to code a scenario (e.g. within a rule) like:

  id = nextval('idseq');
  INSERT INTO tab ( id, ... ) VALUES ( id, ... );
  /* return the result of the following query to the user: */
  SELECT * FROM tab WHERE tab.id = id;

The problem is that there is no way to put the value of the `id'
variable into the last query, when the last query is put into a place,
where its result set is returned to the client (e.g. as the last query
in a rule).

Can I return an open cursor to the client ? Can I otherwise return the
result set of an open cursor, which was returned by a server-side
function, to the client ?

--
Holger Krug
hkrug@rationalizer.com

pgsql-general by date:

Previous
From: tek1
Date:
Subject: alternative place to download pgaccess
Next
From: mordicus
Date:
Subject: Re: Trigger problem