Re: Number of rows in a cursor ?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: neil(dot)saunders(at)accenture(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Number of rows in a cursor ?
Date: 2005-08-24 12:08:22
Message-ID: 69553BE2-F542-421E-8755-2895CB0F1F6C@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Aug 24, 2005, at 6:31 AM, Bo Lorentsen wrote:

> How sad, then I have to repeat the query, first for counting and
> last for data fetch :-(

No, you can use the MOVE command and read how many rows you moved
with something like

MOVE LAST IN mycursor;

http://www.postgresql.org/docs/8.0/interactive/sql-move.html

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Fradkin 2005-08-24 12:42:49 Re: SQLException - SET AUTOCOMMIT TO OFF is no longer supported
Previous Message Russell Simpkins 2005-08-24 11:38:40 Re: SQLException - SET AUTOCOMMIT TO OFF is no longer supported