[unixODBC-support] 64-bit DB2 support/usage question

David Ritter David.Ritter at roguewave.com
Fri Aug 27 19:00:36 BST 2010


I am having trouble bulk inserting data when using unixODBC 2.3.0 in a 64-bit application.

I have a test case where I use SQLBindParameter to insert 5 rows of string data in bulk which demonstrates the issue I am seeing.  I have noted that if I compile my same test directly against the 64-bit DB2 driver it executes correctly.

Output using unixODBC 2.3.0:

described len as 47528108097566
described dataType as 12
-4294967283 13 small stringA
-4294967296 0 
-4294967282 14 small stringAB
-4294967296 0 
-4294967281 15 small stringABC

Output using DB2 9.5fp4 64-bit client library directly:

[ritter at localhost] > t2
described len as 30
described dataType as 12
13 13 small stringA
14 14 small stringAB
15 15 small stringABC
16 16 small stringABCD
17 17 small stringABCDE

Based on the output, it seems as if the SQLLEN and SQLULEN values are somehow getting truncated somewhere in the middle.  Has anyone ever seen this?

I built unixODBC 2.3.0 from source, however I did not see any special options I needed to enable.  I set CFLAGS=-m64 and that was it.  When I run odbc_config it reports:

[ritter at localhost] > odbc_config --version -ulen

I believe I have my odbc.ini and odbcinst.ini files set up correctly.

    [ritter at localhost] > more .odbc.ini
    Description     = Test to DB2
    Driver          = DB2

    [ritter at localhost] > more .odbcinst.ini
    Description     = DB2 Driver
    Driver          = /home/ritter/Database/db2/v9.5_fp4/lib64/libdb2.so
    FileUsage       = 1
    DontDLClose     = 1

Is there something I am doing wrong in building or using unixODBC for a 64-bit application?

Thank you very much for any help anyone can provide.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: odbc_bulk.cpp
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20100827/5c285657/attachment.ksh>

More information about the unixODBC-support mailing list