Return value of SQLRowCount with operations producing no result
Jack Lloyd <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
Hi, I've noticed a difference in behavior in FreeTDS between 0.82 and 0.91 when using it via iODBC 3.52.7. I'm using FreeTDS on Linux, talking to a SQL Server 2008 R2 instance. In 0.82, calling SQLRowCount when the statement was something that does not produce a result (for instance "set lock_timeout 1000", "create table ..." or "drop table ..."), the call returns SQL_SUCCESS, setting the output parameter to -1. This behavior matches that seen running on Windows using the Microsoft ODBC driver. In contrast in 0.91 (as well as the 0.92 snapshot I tried, dated 20120105), SQLRowCount will return SQL_ERROR and does not set the output parameter. GetDiagRec returns "Function sequence error". Was this change intentional? Is there some way I can detect this case (beyond using GetDiagRec if RowCount returns an error and hoping a sequence error won't occur for other reasons)? Thanks, Jack