Re: Return value of SQLRowCount with operations producing no result

Jack Lloyd <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.