[unixODBC-support] unixODBC with DB2 64bit Driver on AIX 5.3

billmon bkehoe at expressor-software.com
Mon May 11 15:31:39 BST 2009

Hi Nick,

Sorry that it has taken me a couple of weeks to get back on this.

I was able to confirm unambiguously that the "IBM Data Server Driver for
(v9.5fp3b_aix64_odbc_cli.tar.gz, File size: 12317294) from 


is indeed returning 32-bit, low integer values for environment, connection
and statement 
handles on SQLAllocHandle calls made from unixODBC by stepping through a
build of unixODBC-2.2.15pre on AIX.

For example, after the call to SQLAllocHandle at line 1321 in

(dbx) print connection->driver_env

I can force the environment handle to a true 64-bit 1 value using

(dbx) assign connection->driver_env = 1
(dbx) print connection->driver_env

as a way to trick the later call to SQLALLOCHANDLE( connection,
SQL_HANDLE_DBC,...) and I see the same thing happen there:

           ret = SQLALLOCHANDLE( connection,
                    connection -> driver_env,
                    &connection -> driver_dbc,
                    connection );
(dbx) print ret
(dbx) print connection->driver_dbc

I can get the unixODBC-2.2.15pre to work with the
v9.5fp3b_aix64_odbc_cli.tar.gz driver if I change
the DRV_SQLHANDLE and DRV_SQLHDESC #defines in drivermanager.h to:

#define DRV_SQLHANDLE                   SQLINTEGER
#define DRV_SQLHDESC                    SQLINTEGER

and rebuild unixODBC-2.2.15pre but then that build fails to work with the
Oracle (and other) ODBC driver on AIX (kind of defeats the purpose of using

This sure does looks like the same problem that existed in DB2 UDB v8
pre-FixPak 11 (See http://www-01.ibm.com/support/docview.wss?uid=swg21238279
) and it's kind of surprising that it should resurface like this in 9.5.

I assume that there is no recourse other then to report this to IBM so that
they can build and release a similar work-around for the latest 9.5 FixPak

Thanks for your insight.


Nick Gorham wrote:
> billmon wrote:
>>I'm trying to establish connectivity between an application using the
>>unixODBC source and I keep hitting the following error:
>>   [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC
>>I am able to successfully use the very same DB2 driver for the same
>>application when the application is directly linked to libdb2.a (using
>>sqlcli includes).
>>Does anyone know whether this v9.5 fixpak 3b DB2 driver for ODBC/CLI works
>>with unixODBC?
> There was a problem in the past where the driver expected the handles to 
> be integers instead of pointers, I don't know if its the case with this 
> driver.  I know IBM had a fixed driver for that.
> -- 
> Nick Gorham
> Easysoft Limited
> http://www.easysoft.com, http://www.unixODBC.org
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support

View this message in context: http://www.nabble.com/unixODBC-with-DB2-64bit-Driver-on-AIX-5.3-tp23322231p23484515.html
Sent from the unixODBC - Support mailing list archive at Nabble.com.

More information about the unixODBC-support mailing list