[unixODBC-support] dependability of type macro values

Eric Sharkey sharkey at netrics.com
Fri Feb 18 16:14:37 GMT 2005

> All you can do is assume the value is fixed. unixODBC uses the same 
> values as Microsoft, and all other DM's I have seen also use the same 
> versions.

Well, I could make a mapping table and standardize these numbers
myself, at least for communication between the driver and datasource.

And what about things like this?:

#if (ODBCVER >= 0x0300)
#define SQL_INTERVAL_YEAR                       (100 + SQL_CODE_YEAR)
#define SQL_INTERVAL_YEAR                       (-80)
#endif  /* ODBCVER >= 0x0300 */

If an application was written and compiled for ODBC 2.0, and it tries
to use an ODBC 3.x driver, won't it have a problem if it tries to use
these numeric codes?  The driver manager doesn't map these values,
does it?  Is the driver supposed to do this? 

Also, how do I assign values to types not defined by ODBC?  The docs
for SQLGetTypeInfo say DATA_TYPE may be "an ODBC SQL data type or a
driver-specific SQL data type", but I don't see anywere a guide for
how to pick driver-specific SQL data type codes which won't conflict
with ODBC SQL data type codes.


More information about the unixODBC-support mailing list