[freetds] Update statement & SQL_NO_DATA

Raju Mohanapu raju.mohanapu at wombatfs.com
Mon Jan 26 12:31:33 EST 2009


Hello Folks,
The issue is related to the one discussed in 
http://lists.ibiblio.org/pipermail/freetds/2008q1/022992.html

SQLExecute (preparedUpdateStatement) returns SQL_SUCCESS even when no 
rows are affected. For performance reasons, I wouldn't like to execute 
another command on the database to find whether any rows are affected by 
the just executed update statement. It would be ideal for me if the 
SQLExecute returned SQL_NO_DATA if no rows are affected. I believe this 
is the behavior indicated in ODBC docs as well.

The above thread indicates that a patch has been applied to return 
SQL_SUCCESS always and reserve SQL_NO_DATA for SQLFetch.

Is there a particular version of freeTDS that returns SQL_NO_DATA, 
rather than SQL_SUCCESS, when no rows are affected by an 
updateStatement? or any config/tricks to get this behavior?

Here is my env:
freeTDS version: 0.82
unixODBC: 2.2.11
Database: MS SQL Server 2008
ODBC version: 3

Appreciate your reply.

Thank you

regards
Raju


More information about the FreeTDS mailing list