[unixODBC-support] dependability of type macro values

Eric Sharkey sharkey at netrics.com
Fri Feb 18 15:05:41 GMT 2005


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?

Eric



More information about the unixODBC-support mailing list