Skip to Content.
Sympa Menu

freetds - Re: [freetds] SQLRowCount problem with freeTDS+unixODBC+PHP with MSSQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] SQLRowCount problem with freeTDS+unixODBC+PHP with MSSQL
  • Date: Sat, 17 Dec 2005 19:13:59 +0100

Il giorno ven, 16/12/2005 alle 13.34 -0800, Roger Peña Escobio ha
scritto:
> as soon as I sent the messages I had another question
> about this topic:
>
> --- "Lowden, James K" <LowdenJK AT bernstein.com> wrote:
>
> > > From: Roger "Pe�a" Escobio
> > > Sent: Friday, December 16, 2005 3:44 PM
> > >
> > > I can't retrive the correct RowCount after a
> > 'select' query, nor
> > > do I can call another query, but if I run across
> > all the result
> > > (either with odbc_fetch_row() of odbc_result_all()
> > ) I can get the
> > > _right_ RowCount and execute another SQL query
> >
> > http://www.freetds.org/faq.html#pending
> >
> > These issues are both related to the fact that the
> > rows are transmitted as the server fetches them.
> > Until the last row is fetched, the rowcount is not
> > known.
> >
> > > another problem is that the "row pointer", the one
> > that allow to
> > > retrive a particular row from the result, do not
> > work at all :-(
>
> if you are right, why the same PHP application run ok,
> without any complain, in a Windows plataform ? with
> other ODBC driver (I have to check which one)
> php still should re-use the same connection, is it?
> so my no-knowledge say that it have to do with the
> driver also
>
> another question that I have is why I can retrive an
> specific row from the result of a query? the 2nd
> argument of the function odbc_fetch_row() do work at
> all :-(
> bool odbc_fetch_row ( resource result_id [, int
> row_number] )
>
> is this a problem with freetds or an up-layer
> (unixODBC, php) problem?
>
> thanks
>
> roger
>

I think that this has to do with cursors. From php_odbc.c

#ifdef HAVE_SQL_EXTENDED_FETCH
if (result->fetch_abs) {
if (numArgs > 1)
rc =
SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus);
else
rc =
SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus);
} else
#endif
rc = SQLFetch(result->stmt);

SQL_FETCH_ABSOLUTE calling SQLExtendedFetch require cursors support. As
we do not still provide this support row numbers do not work.

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page