Skip site navigation (1) Skip section navigation (2)

Re: get number of rows selected

From: Andrei Kovalevski <andyk(at)commandprompt(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Cc: Adam M <gnuman1(at)gmail(dot)com>, Malm Paul <paul(dot)malm(at)saabgroup(dot)com>
Subject: Re: get number of rows selected
Date: 2008-04-07 01:30:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc

Take a look at SQLRowCount( ). You may note:

*/For other statements and functions, the driver may define the value 
returned in *RowCountPtr. For example, some data sources may be able to 
return the number of rows returned by a SELECT statement or a catalog 
function before fetching the rows./*

You may rely on this when using  psqlODBC or  ODBCng with buffering mode 
ON (default).

Adam M wrote:
> Generally you would do that with a count function instead of relying
> on something else.
> "select * from layer where visible = 1"
> so I guess "SELECT COUNT(*) FROM layer WHERE visible=1" would give you
> the answer.
> - Adam
Andrei Kovalevski
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng -

In response to

pgsql-odbc by date

Next:From: Andrei KovalevskiDate: 2008-04-07 01:35:57
Subject: Re: Connection of postgres
Previous:From: noreplyDate: 2008-04-03 17:20:30
Subject: [ psqlodbc-Bugs-1010368 ] connection problem with postgresql driver 8.03.0100 to postgresql 8.3.0

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group