[unixODBC-support] DB2, Driver's SQLAllocHandle on SQL_HANDLE_HENV
Chunmei Wu
chunmei.wu at oracle.com
Fri May 7 10:08:20 BST 2010
Hi Nick,
After setting this environment:
unixuser\@dsliaa05 # > env|grep DB2INSTANCE
DB2INSTANCE=unixuser
The error is changed which is not 'Driver's SQLAllocHandle on SQL_HANDLE_HENV' error:
unixuser\@dsliaa05 # > ./isql -v Q10F qadmin qadmin
[IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed
[ISQL]ERROR: Could not SQLConnect
I can connect this DB using db2:
unixuser\@dsliaa05 # > db2 connect to Q10F user QADMIN using QADMIN
Database Connection Information
Database server = DB2 z/OS 9.1.5
SQL authorization ID = QADMIN
Local database alias = Q10F
Following is the definition of Q10F in odbc.ini
[Q10F]
ServerName=Q10F
Driver=/opt/IBM/db2/V9.7/lib64/db2o.o
Thanks,
Chunmei Wu
-----Original Message-----
From: Nick Gorham [mailto:nick at lurcher.org]
Sent: 2010年5月7日 15:21
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] DB2, Driver's SQLAllocHandle on SQL_HANDLE_HENV
Chunmei Wu wrote:
> Hi Nick,
>
> Thanks for your kind reply.
>
> I tried your suggestion, but same error still occur. Following is my procedure:
> 1> set following env
> setenv OBJECT_MODE 64
> setenv CFLAGS -q64
> setenv CC xlc_r
> setenv CCC xlC_r
>
> 2> Run configure
> ./configure --prefix=/home/eng-sm/unixuser/claire/test/perl/unixodbc_install2.3.0_64 --enable-gui=no --enable-drivers=no
>
> 3> edit DriverManager/driver_manager.h
> #define DRV_SQLHANDLE SQLHANDLE
> #define DRV_SQLHDESC SQLHDESC
>
> Change the def to
>
> #define DRV_SQLHANDLE int
> #define DRV_SQLHDESC int
>
> 4> make clean
> make
> make install
>
> 5> cd $ODBCHOME/bin
> unixuser\@dsliaa05 # > isql -v Q10F qadmin qadmin
> [IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
> [ISQL]ERROR: Could not SQLConnect
>
>
> Thanks,
> Chunmei Wu
>
> -----Original Message-----
> From: Nick Gorham [mailto:nick.gorham at easysoft.com]
> Sent: 2010年5月6日 16:47
> To: Support for the unixODBC project
> Subject: Re: [unixODBC-support] DB2, Driver's SQLAllocHandle on SQL_HANDLE_HENV
>
> Chunmei Wu wrote:
>
>> Hi everyone,
>>
>> I’m using the latest unixODBC 2.3.0 in AIX and DB2, and faced this error
>> [IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
>>
>> I found similar problem in http://mailman.unixodbc.org/pipermail/unixodbc-support/2006-July/000982.html. Following reply is from Nick:
>> It will be because there is a bug in a version of the 64 bit DB2 driver that assumes that a handle is a 32 object, and its not in this case. I think IBM have done a fix. The 2.2.12pre release on the ftp site has a way of working around this. from the Change file
>>
>> * Allow decoupling of SQLHANDLES between application and driver, there is a 64bit DB2 where the driver handles are int's but unixODBC uses void *.
>> There is a define for DRV_SQLHANDLE in DriverManager/drivermanager.h that allows this choice at build time
>>
>> The change file said “There is a define for DRV_SQLHANDLE in DriverManager/drivermanager.h that allows this choice at build time”, is there any configuration option related with this choice?
>>
> In the source tree, edit DriverManager/driver_manager.h
>
> Look for:
>
> /*
> * its possible that the driver has a different definition of a handle
> to the driver
> * manager, DB2 64bit is a example of this
> */
>
> #define DRV_SQLHANDLE SQLHANDLE
> #define DRV_SQLHDESC SQLHDESC
>
> Change the def to
>
> #define DRV_SQLHANDLE int
> #define DRV_SQLHDESC int
>
> And then
>
> make clean
> make
>
>
Well, it may be back to Martins suggestion, have you got DB2INSTANCE set?
Can you connect using the db2 command line tool?
--
Nick
_______________________________________________
unixODBC-support mailing list
unixODBC-support at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
More information about the unixODBC-support
mailing list