AnsweredAssumed Answered

ODBC driver incorrectly returns 0 for SQLNumResultCols

Question asked by barefootguru on May 7, 2013

Summary

ODBC driver incorrectly returns 0 for SQLNumResultCols

Product

FileMaker Server

Version

12.0v3

Operating system version

Windows Server 2008 R2 Enterprise SP1

Description of the issue

According to the ODBC spec the SQLNumResultCols function is meant to return the number of columns, but when used with a where statement the FileMaker ODBC driver returns 0.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms715393(v=vs.85).aspx

(SAS track 7610977755)

Steps to reproduce the problem

options sastrace='d,,d,d' sastraceloc=saslog nostsuffix;

libname Fm12  odbc dsn='test12'  password='xxx'  user='xxx' ;

proc sql;
  delete from fm12.test12
  where field1='julien';
quit;

Expected result

SQLResultNumCols returns the number of columns, and records are removed.

Actual result

The driver is returning a 0 for SQLResultNumCols causing SAS to crash. To quote the SAS developer:
".... it seems like an odd case where the driver/server return SQLNumResultCols as 0 when no data is found b/c of the where clause.  Which doesn’t quite seem right to me. I would expect that should report 1 for field1 regardless of whether it finds data or not....".

Configuration information

Workstation used to pull ODBC data is:

Windows 7 64-bit with 32-bit SAS 9.3 T1M2 and 32-bit FileMaker Pro ODBC driver 12.03.103.00

Workaround

Note:  the ODBC driver supplied with FileMaker 10 worked well.  The ones supplied with version 12 behave like beta versions.

Outcomes