Skip to Content.
Sympa Menu

freetds - [freetds] types as returned by SQLDescribeCol

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] types as returned by SQLDescribeCol
  • Date: Mon, 28 Jan 2008 00:35:14 -0500

When building an ODBC application without a DM, do I need to #define
ODBCVER=0x300 or anything like that? I'm not getting the types I expect.

With a table defined as:

create table T ( t int NULL
, r real NULL
, s varchar(30) NULL)

calling SQLDescribeCol returns SQL_SUCCESS for column 1 fills the
DataTypePtr buffer with the value 4 (0x4).

I am calling

SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,
(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_UINTEGER))

as soon as the environment handle is allocated.

Based on http://msdn2.microsoft.com/en-us/library/ms714556(VS.85).aspx I
am expecting SQL_C_SLONG. In my sqlext.h I see:

#define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET)
#define SQL_SIGNED_OFFSET (-20)
#define SQL_C_LONG SQL_INTEGER

and in sql.h

#define SQL_INTEGER 4

so it would appear I'm getting SQL_INTEGER instead....

Also, does my application have to handle both, or can it demand 3.0
behavior?

Many thanks.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page