IBM Support

How to Build unixODBC, Perl DBI and Perl DBD::ODBC on a Linux 64-bit Client

Troubleshooting


Problem

Installing unixODBC, Perl DBI and DBD::ODBC using standard instructions have shown truncation issues when the DB is queried using Perl scripts.

Diagnosing The Problem

This document applies to Linux 64-bit client systems.

Netezza tests found that this is not a problem in the Netezza 64-bit ODBC driver. The problem occurs with the unixODBC and the Perl modules.

Resolving The Problem

To avoid truncation issues when the database is queried using Perl scripts, compile and install unixODBC and the Perl modules DBI and DBD::ODBC using the following steps:

1. Download the latest unixODBC source code package from the following site: http://www.unixodbc.org

2. Extract the package to a new directory such as /opt/unixodbc_2.2.14_64/unixODBC-2.2.14.

3. Update the following parameters in the Makefile file:
(You could use environment variables instead.)
CFLAGS = -g -O2 -DENABLE_INI_CACHING -pthread -DBUILD_REAL_64_BIT_MODE
CPPFLAGS = -DBUILD_REAL_64_BIT_MODE


4. Change to the extraction folder and then run the following commands:
./configure --prefix=/opt/unixodbc_2.2.14_64 --enable-gui=no --enable-drivers=no
make
sudo make install


5. Update the following environment variable:
LD_LIBRARY_PATH: "export LD_LIBRARY_PATH=/opt/unixodbc/lib:$LD_LIBRARY_PATH"


6. Download the DBI Perl module from CPAN:
http://dbi.perl.org/ 

7. Install the DBI Perl module:
perl -MCPAN -e shell, install DBI


8. Download the DBD::ODBC Perl module source code from CPAN:
http://search.cpan.org/search?query=DBD%3A%3AODBC&mode=all

9. Untar the DBD-ODBC-<version>.tar.gz file on the /tmp directory.
 
10. Change to the /tmp/DBD-ODBC-<version> directory and run the following commands:
perl Makefile.PL -o /opt/unixodbc_2.2.14_64/
make
make install


11. Define DSN within the .odbc.ini and odbcinst.ini files as described in the Netezza Performance Server ODBC, JDBC and OLE DB User Guide.

12. Test ODBC connectivity from your Perl scripts.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ844745

Document Information

More support for:
IBM PureData System

Software version:
1.0.0

Document number:
461767

Modified date:
17 October 2019

UID

swg21569413