Skip to Content.
Sympa Menu

freetds - Re: [freetds] Num of rows ruturned by a query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "martin martin" <acevedoma AT hotmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] Num of rows ruturned by a query
  • Date: Fri, 29 Apr 2005 00:54:22 +0000

Thanks for your answer, but I need this feature for extending a 3th part open source project that requires the num rows to work properly and the others db implementation support this(MySql, Postgre), I know that in ado is possible when you create a Client Cursor, is it also available in db lib?, can I get a client cursor or a client result?

From: Brian Bruns <brian.bruns AT gmail.com>
Reply-To: brian AT bruns.com,FreeTDS Development Group <freetds AT lists.ibiblio.org>
To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Subject: Re: [freetds] Num of rows ruturned by a query
Date: Thu, 28 Apr 2005 20:14:24 -0400

This is a protocol limitation. The advantage of sql server doing it
this way is that it can begin returning rows before knowing how many
there will be. That is, if you "order by" an indexed column the
server begins sending rows immediately without building a work table
and therefore the total number is unknown.

Work arounds are to do a count(*) first or to row buffer the results
(if you know the number of rows is relatively small).

Brian

On 4/28/05, martin martin <acevedoma AT hotmail.com> wrote:
> Is it possible to know how many rows are returned by a "select" query before
> iterating the rows.
> I use a -db-lib- function's "dbcount ()" but it always returns -1 before
> fetching the rows.
> Thanks
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds






Archive powered by MHonArc 2.6.24.

Top of Page