[freetds] affected rows
James K. Lowden
jklowden at freetds.org
Mon Feb 12 23:43:31 EST 2007
kris at bobbl.be wrote:
> I mean for update queries, forgot to mention that :)
> Selects and sp's work just fine.
>
> It is usefull to know how much changes have been made to the database.
Indeed. Please see the code for dbcount() in src/dblib/dblib.c. I think
that does what you want.
The usual warning about using libtds applies, of course. I always
recommend people use db-lib instead.
> > I am trying to retrieve the affected rowcount from an mssql2k server
> > with freetds, how is that done with the latest version ?
> >
> > I manage to get resultsets, recordsets and rows from select
> > statements.
> >
> > Here is what I do :
> > while ((rc = tds_process_tokens(pSocket, &res_type, &done_flags,
> > TDS_TOKEN_RESULTS|TDS_RETURN_ROWFMT|TDS_RETURN_COMPUTEFMT|TDS_RETURN_
> > DONE|TDS_STOPAT_ROW|TDS_STOPAT_COMPUTE|TDS_RETURN_PROC))
> > == TDS_SUCCEED) {
> > printf("%i\n", res_type);
> > printf("%p\n", pSocket->res_info);
> >
> > but it always returns pSocket->res_info nil, what am i missing ?
HTH.
--jkl
More information about the FreeTDS
mailing list