openlink / iODBC

An open-source ODBC driver manager and SDK that facilitates the development of database-independent applications on linux, freebsd, unix and MacOS X platforms.
http://www.iodbc.org/
Other
162 stars 52 forks source link

iODBC on AIX #77

Open lm8 opened 2 years ago

lm8 commented 2 years ago

We're using Cognos on AIX 7.2 and were told that we need to use iODBC to connect to a database through the Cognos product. IBM claimed they supply a version of iODBC with Cognos as per their documentation: https://www.ibm.com/docs/en/cognos-analytics/11.0.0?topic=sudcrd-access-odbc-data-sources-unix-linux-operating-systems which states "On UNIX operating systems, the open source iODBC driver manager is provided as part of the IBM Cognos installation." However, when we contacted IBM support they said the documentation was wrong and they do not supply a copy of iODBC with installation. I attempted to build iODBC from the source code on AIX using version 3.52.15. I'm using gcc and creating 32 bit libraries and executables since Cognos does not support 64 bit database drivers for that product. iODBC built from source with no major issues. However, when we try to connect to either a PostgreSQL database using the PostgreSQL ODBC driver or a Microsoft SQL database using FreeTDS, we see garbage on the screen.

This is a typical output we see when we run iodbctest: 1: SQLDriverConnect = ol o onc osre:Afl rdrcoyi h ahnm osnteit I h evrrniglclyadacpig oncin nUi oansce /m/sPSL53" (101) SQLSTATE=80 1: ODBC_Connect = ol o onc osre:Afl rdrcoyi h ahnm osnteit I h evrrniglclyadacpig oncin nUi oansce /m/sPSL53" (101) SQLSTATE=80

I've tried building unixODBC from source as well and connecting to the same databases with the same drivers and it works. However, IBM does not support unixODBC on AIX and claims we can only get Cognos to connect if we have a working version of iODBC.

We've tried to debug the SQL error numbers that were displayed with no luck. We've tried several different settings with the odbc.ini file. Also, no luck. The exact same drivers work fine with no errors with UnixODBC. We're unable to get any assistance from IBM on this even though they advised us to buy an AIX system and claimed that Cognos supported connection to PostgreSQL with iODBC.

Do you have any ideas why we're seeing gibberish in the error messages or how to get a connection working properly on AIX? Is there anything specific we need to make sure to do when building iODBC for AIX. We're building the source code with the following settings: export OBJECT_MODE=32 CFLAGS includes -maix32 LDFLAGS includes -maix32 -Wl,-bbigtoc

Thank you.

openlink commented 2 years ago

Please try adding the following flag to your postgres or freetds DSN:

DriverUnicodeType=UTF16