65pony wrote:
> I am trying to use 2 different databases within a single perl script
> running on AIX 5.3. 1 being DB2 via DBD::DB2 and the other MSSQL via
> DBD::ODBC
> 
> I am able to connect to each database and get unique db handles
> however whenever I try and use the ODBC connection, for a prepare
> statement for example, I get the following error
> 
> DBD::ODBC::db prepare failed: [IBM][CLI Driver][DB2/AIX64] SQL0204N
> "table_name" is an undefined name.  SQLSTATE=42704
>  (SQL-42S02)
> 
> If I comment out the DBD::DB2 connection this prepare works and I get
> the expect results back.. I am not sure why the IBM CLI driver is
> sticking it's ugly nose in as I would expect a ODBC driver error not a
> [IBM][CLI Driver][DB2/AIX64] error.
> 
> Here are the version of the modules I am using:
> /opt/freeware/bin/perl -MDBI -e 'DBI->installed_versions;'
>   Perl            : 5.008008    (ppc-thread-multi)
>   OS              : aix (5.1.0.0)
>   DBI             : 1.607
>   DBD::Sponge     : 12.010002
>   DBD::Proxy      : install_driver(Proxy) failed: Can't locate RPC/
> PlClient.pm in @INC
>   DBD::ODBC       : 1.23
>   DBD::Gofer      : 0.011565
>   DBD::File       : 0.35
>   DBD::ExampleP   : 12.010007
>   DBD::DBM        : install_driver(DBM) failed: Can't locate DBD/File/
> Statement.pm in @INC
>   DBD::DB2        : 1.76
> 
> 

There has been a long standing problem with using DBD::ODBC, unixODBC
(or MS ODBC driver manager) and an ODBC driver with DBD::DB2 as IBM's
CLI library has entry points (API names) which conflict with ODBC i.e.,
both ODBC and IBM CLI have SQLxxx functions.

There are ways around this on UNIX that some people have managed to get
working by setting PERL_DL_NONLAZY=1. I'd search an archive of this list
and you should find this issue has cropped up before. You may also find
http://www.easysoft.com/support/kb/kb00664.html useful.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to