freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] PHP und Freetds
- Date: Sat, 22 Mar 2008 10:08:35 -0400
Thomas, Christopher (LLU) wrote:
>
> I have had trouble with the odbc_num_rows() function. It seems to always
> return -1 if you call it just after odbc_exec(). For me, it always
> returned the right value after I looped through all the results.(useless
> at that point)
http://www.freetds.org/faq.html#pending
The driver cannot tell you something the server itself doesn't know. The
server sends the rows as they are produced, and can't (and therefore
doesn't) send the rowcount until the last row is sent.
Equally, the driver cannot tell you the rowcount before it fetches the
last row. To produce the rowcount prior to the application fetching the
last row, it would have to cache the rows in advance.
If you think it through, you'll see that *every* server -- any RDBMS, not
just TDS servers -- face the same problem: you can't know the answer
before you calculate it. You have to construct the rows before you know
how many there are. Any system that provides the rowcount in advance of
the rows themselves is caching the rows, and any client of such a system
always pays the price of that overhead, regardless of its value to the
application.
--jkl
-
[freetds] PHP und Freetds,
Christian, 03/21/2008
-
Re: [freetds] PHP und Freetds,
Thomas, Christopher (LLU), 03/21/2008
-
Re: [freetds] PHP und Freetds,
James K. Lowden, 03/22/2008
-
Re: [freetds] PHP und Freetds,
Robin Smith, 03/24/2008
- Re: [freetds] PHP und Freetds, ZIGLIO, Frediano, VF-IT, 03/25/2008
-
Re: [freetds] PHP und Freetds,
Robin Smith, 03/24/2008
-
Re: [freetds] PHP und Freetds,
James K. Lowden, 03/22/2008
-
Re: [freetds] PHP und Freetds,
Thomas, Christopher (LLU), 03/21/2008
Archive powered by MHonArc 2.6.24.