pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Kovalevski <andyk@commandprompt.com>
To: pgsql-odbc@postgresql.org
Cc: Adam M <gnuman1@gmail.com>
Cc: Malm Paul <paul.malm@saabgroup.com>
Subject: Re: get number of rows selected
Date: Mon, 07 Apr 2008 04:30:16 +0300
Message-ID: <47F97928.6010905@commandprompt.com> (raw)
In-Reply-To: <84b37b360804030930o1b771e47ib9082bf3cecb54f6@mail.gmail.com>
References: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se>
	<84b37b360804030930o1b771e47ib9082bf3cecb54f6@mail.gmail.com>

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/

view thread (4+ messages)  latest in thread

Message-ID: <47F97928.6010905@commandprompt.com>
Permalink:  ../47F97928.6010905@commandprompt.com/
Also on:    postgresql.org/message-id/47F97928.6010905@commandprompt.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: andyk@commandprompt.com, gnuman1@gmail.com, paul.malm@saabgroup.com
  Subject: Re: get number of rows selected
  In-Reply-To: <47F97928.6010905@commandprompt.com>
  References: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se> <84b37b360804030930o1b771e47ib9082bf3cecb54f6@mail.gmail.com> <47F97928.6010905@commandprompt.com>

* 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