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: Roger "Pe�a" Escobio <orkcu AT yahoo.com>
  • 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 16:52:31 -0800 (PST)



--- Frediano Ziglio <freddyz77 AT tin.it> wrote:

> 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
>

thanks very much for yours quick anwsers, freddy and
james, now I have a better understanding
I am a system admin not a developer but I will try to
point this need into our system, maybe we can get some
code

cu
roger

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




Archive powered by MHonArc 2.6.24.

Top of Page