Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 9CC8A2E007C for ; Sun, 6 Apr 2008 23:20:08 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 15486-05 for ; Sun, 6 Apr 2008 23:19:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id 96A2C2E0067 for ; Sun, 6 Apr 2008 23:20:05 -0300 (ADT) Received: from [77.109.25.54] (77-109-25-54.dynamic.peoplenet.ua [77.109.25.54]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m371V1GL012518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Apr 2008 18:31:07 -0700 Message-ID: <47F97928.6010905@commandprompt.com> Date: Mon, 07 Apr 2008 04:30:16 +0300 From: Andrei Kovalevski User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-odbc@postgresql.org CC: Adam M , Malm Paul Subject: Re: get number of rows selected References: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se> <84b37b360804030930o1b771e47ib9082bf3cecb54f6@mail.gmail.com> In-Reply-To: <84b37b360804030930o1b771e47ib9082bf3cecb54f6@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------090906070702000905030802" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Sun, 06 Apr 2008 18:31:11 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/17 X-Sequence-Number: 9480 This is a multi-part message in MIME format. --------------090906070702000905030802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, Take a look at SQLRowCount( http://msdn2.microsoft.com/en-us/library//ms711835.aspx ). 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 - http://www.commandprompt.com/ --------------090906070702000905030802 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello,

Take a look at SQLRowCount( http://msdn2.microsoft.com/en-us/library//ms711835.aspx ). 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 - http://www.commandprompt.com/
--------------090906070702000905030802--