freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Peter Deacon <peterd AT iea-software.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: [freetds] SQLRowCount
- Date: Sun, 30 Mar 2003 17:05:09 -0800 (Pacific Standard Time)
This should be about right for SQLRowCount..
RowCount is normally the number of rows effected by update ops.
The odbc documentation mentions if rowcount is not avaliable you should
return -1.
With the driver rowcounts for SELECTs are not avaliable until after you've
downloaded all rows from the database. Set -1 initially so those who
check for a count initially won't be confused.
Have Fun!
Peter
SQLRowCount(SQLHSTMT hstmt, SQLINTEGER FAR * pcrow)
...
tds = stmt->hdbc->tds_socket;
if (tds->rows_affected == TDS_NO_COUNT)
{
if (tds->res_info != NULL)
{
if (tds->res_info->row_count == 0)
*pcrow = -1;
else
*pcrow = tds->res_info->row_count;
}
else
*pcrow = -1;
}
else
*pcrow = tds->rows_affected;
return SQL_SUCCESS;
...
-
[freetds] SQLRowCount,
Peter Deacon, 03/30/2003
- <Possible follow-up(s)>
- RE: [freetds] SQLRowCount, ZIGLIO Frediano, 03/31/2003
Archive powered by MHonArc 2.6.24.