[unixODBC-support] dependability of type macro values

Nick Gorham nick.gorham at easysoft.com
Fri Feb 18 15:41:07 GMT 2005

Eric Sharkey wrote:

>Are the values of the ODBC type macros considered part of the ODBC
>standard?  IOW, can I count on the fact that SQL_VARCHAR is 12,
>will be 12 everywhere (unixODBC, iODBC, MS ODBC, ...), and will
>always be 12 throughout perpetuity?
>The reason I ask is that SQLColumns() is supposed to return the
>type of a column as a smallint.  My datasource can send back what it
>thinks is the ODBC type code for the column, as a smallint, based on
>the values in sql.h used to compile the datasource.  If the application
>has different macro values, this could lead to problems.  Do I need
>to define my own type codes, or can I depend on the client and server
>always having the same numeric values in sql.h?

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 


More information about the unixODBC-support mailing list