Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iODBC doesn't map 3.x data types for 2.x applications #6

Open
mfripp opened this issue Jul 16, 2014 · 0 comments
Open

iODBC doesn't map 3.x data types for 2.x applications #6

mfripp opened this issue Jul 16, 2014 · 0 comments
Assignees

Comments

@mfripp
Copy link

mfripp commented Jul 16, 2014

According to the docs at http://msdn.microsoft.com/en-us/library/ms714714(v=vs.85).aspx , ODBC driver managers should remap field type identifiers between ODBC 3.x (e.g., SQL_TYPE_TIMESTAMP=93) and 2.x (e.g., SQL_TIMESTAMP=11) when apps and drivers use different ODBC versions. iODBC does this in SQLDescribeCol, but not in SQLGetTypeInfo. As a result, apps that use ODBC version 2.x cannot successfully get field type information from drivers that use ODBC version 3.x. (Presumably the reverse is also true.)

This results in an error message ("Could not find SQL synonym for SQL_TIMESTAMP.") with the latest version of the AMPL ODBC handler (20131212, http://www.netlib.org/ampl/tables/amplodbc.c) when connecting to the latest version of the MySQL ODBC driver (5.3.2).

Recommended changes: update SQLGetTypeInfo code in iodbc/catalog.c to remap data types between ODBC 3.x and ODBC 2.x, depending on the ODBC version chosen by the app at runtime. This is similar to what is done in SQLDescribeCol in iodbc/result.c, but would require remapping the DataType argument of SQLGetTypeInfo and also the data_type specified in the result set returned by the driver (see http://msdn.microsoft.com/en-us/library/ms714632(v=vs.85).aspx ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants