[unixODBC-dev] API differences sql.h unixODBC vs. MS

Eric Sharkey sharkey at netrics.com
Mon Dec 20 17:43:07 GMT 2004


Hi all,

I'm writing an ODBC driver and I'm running into some small differences
in the SQL function API's as listed in unixODBC's sql.h compared with
the MS version.

For example, from MS's SQL.H I have:

SQLRETURN  SQL_API SQLBindCol(SQLHSTMT StatementHandle,
                   SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
                   SQLPOINTER TargetValue, SQLINTEGER BufferLength,
                   SQLINTEGER *StrLen_or_Ind);

and unixODBC defines:

SQLRETURN  SQL_API SQLBindCol(SQLHSTMT StatementHandle,
                   SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
                   SQLPOINTER TargetValue, SQLLEN BufferLength,
                   SQLLEN *StrLen_or_Ind);

Where two SQLLENs used in unixODBC are SQLINTEGERs in the MS
version.

What is the recommended way to resolve these kinds of differences
when writing a driver?

This:

#ifdef WIN32
#define SQLLEN SQLINTEGER
#define SQLULEN SQLUINTEGER
#define SQLROWOFFSET SQLINTEGER
#endif

at the top of my driver header seems to get the job done, but doesn't
feel right.

Thanks,

Eric Sharkey



More information about the unixODBC-dev mailing list