Skip to Content.
Sympa Menu

freetds - [freetds] Return value of SQLRowCount with operations producing no result

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jack Lloyd <lloyd AT randombit.net>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Return value of SQLRowCount with operations producing no result
  • Date: Fri, 13 Jan 2012 15:09:10 -0500

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




Archive powered by MHonArc 2.6.24.

Top of Page