Unicode ODBC driver with support of SQLForeignKeys?

From: Lothar Behrens <lothar(dot)behrens(at)lollisoft(dot)de>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Unicode ODBC driver with support of SQLForeignKeys?
Date: 2009-06-05 11:51:09
Message-ID: 1F582784-BC3D-447A-8711-E92094B68BEC@lollisoft.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

I have installed the package pgplus-837-1-linux-x32 on my openSuSE
11.1 system. After figuring out that SQLForeignKeys did not
result me in the expected list of foreign keys I tried to use the
source code.

I grabbed the source code of version 08.03.0400 and build it as follows:

# configure
# make

I got a problem with the SQLColAttribute definition of the header file
(unixODBC 2.2.14) located in /usr/local/include:

SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
SQLUSMALLINT FieldIdentifier,
SQLPOINTER
CharacterAttribute, SQLSMALLINT BufferLength,
SQLSMALLINT *StringLength,
SQLLEN *NumericAttribute
/* spec
says (SQLPOINTER) not (SQLEN*) - PAH */ );
/* Ms
now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp
- NG */

SQLRETURN SQL_API SQLColAttributeW(
SQLHSTMT hstmt,
SQLUSMALLINT iCol,
SQLUSMALLINT iField,
SQLPOINTER pCharAttr,
SQLSMALLINT cbCharAttrMax,
SQLSMALLINT *pcbCharAttr,
SQLLEN *pNumAttr);

And as of http://msdn.microsoft.com/de-de/library/ms713558(en-us,VS.85).aspx
SQLLEN is used.

The code of psqlODBC driver is as follows:

/* SQLColAttributes -> SQLColAttribute */
SQLRETURN SQL_API
SQLColAttribute(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
SQLUSMALLINT FieldIdentifier,
SQLPOINTER CharacterAttribute,
SQLSMALLINT BufferLength,
SQLSMALLINT *StringLength,
#if defined(_WIN64)
SQLLEN *NumericAttribute
#elif defined(WITH_UNIXODBC) || defined(WIN32)
SQLPOINTER NumericAttribute
#else
SQLLEN *NumericAttribute
#endif
)

SQLRETURN SQL_API SQLColAttributeW(
SQLHSTMT hstmt,
SQLUSMALLINT iCol,
SQLUSMALLINT iField,
SQLPOINTER pCharAttr,
SQLSMALLINT cbCharAttrMax,
SQLSMALLINT *pcbCharAttr,
#if defined(WITH_UNIXODBC) || (defined(WIN32) && ! defined(_WIN64))
SQLPOINTER pNumAttr
#else
SQLLEN *pNumAttr
#endif
)

Activated is WITH_UNIXODBC and now my question are the following:

What unixODBC code version matches to what psqlODBC code version?

Is there a version that matches unixODBC 2.2.14?

And at least what versions do support SQLForeignKeys?

Thanks

Lothar

-- | Rapid Prototyping | XSLT Codegeneration | http://www.lollisoft.de
Lothar Behrens
Heinrich-Scheufelen-Platz 2
73252 Lenningen

Browse pgsql-odbc by date

  From Date Subject
Next Message Moreno D. 2009-06-06 11:19:18 Re: Show max_identifier_length causes heavy query execution
Previous Message Dragan Matic 2009-06-05 11:01:23 Re: odbc silently dropping national characters in CP1250 encoding