[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    RE: [freetds] SQLRowCount
From:       ZIGLIO Frediano <Frediano.Ziglio () vodafoneomnitel ! it>
Date:       2003-03-31 9:13:16
[Download RAW message or body]

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

Applied.
As usual a good patch, thanks Peter

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================
_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic