Skip to Content.
Sympa Menu

freetds - Re: [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: Re: [freetds] Return value of SQLRowCount with operations producing no result
  • Date: Fri, 13 Jan 2012 16:49:18 -0500

On Fri, Jan 13, 2012 at 03:09:10PM -0500, Jack Lloyd wrote:

> 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".

A related case - SQLNumResultCols will also fail in 0.91 in this
situation. Microsoft's ODBC documentation says "If the statement
associated with StatementHandle does not return columns,
SQLNumResultCols sets *ColumnCountPtr to 0." [*] and 0.82 followed
that.

[*]
http://msdn.microsoft.com/en-us/library/windows/desktop/ms715393%28v=vs.85%29.aspx




Archive powered by MHonArc 2.6.24.

Top of Page