ODBC Driver 11 for SQL Server and SQLGetData limitations

心已入冬 提交于 2019-12-12 13:22:54

问题


The SQLGetData Function reference explains the following general limitation of the API:

If the driver does not support extensions to SQLGetData, the function can return data only for unbound columns with a number greater than that of the last bound column. Furthermore, within a row of data, the value of the Col_or_Param_Num argument in each call to SQLGetData must be greater than or equal to the value of Col_or_Param_Num in the previous call; that is, data must be retrieved in increasing column number order.

The ODBC API implementation details article on the SQLGetData adds information specific to the SQL Server Native Client driver:

The SQL Server Native Client ODBC driver does not support using SQLGetData to retrieve data in random column order. All unbound columns processed with SQLGetData must have higher column ordinals than the bound columns in the result set.

Does this column ordering limitation apply to the new and recommended Microsoft ODBC Driver for SQL Server?

Is there any difference in this behaviour between the current ODBC Driver 11 for SQL Server version and the upcoming version ODBC Driver 13 (Preview) for SQL Server?


回答1:


You can test the drivers cababilities from code by calling the SQLGetInfo ODBC function.

ODBC Driver 13 for SQL Server returns the following:

SQL_GETDATA_EXTENSIONS:
        SQL_GD_ANY_COLUMN false
        SQL_GD_ANY_ORDER false


来源:https://stackoverflow.com/questions/35093643/odbc-driver-11-for-sql-server-and-sqlgetdata-limitations

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!