Hi Lee:

You must have the DB2 client environment installed on any machine
where you expect to run DBD::DB2 perl applications.  That driver
is dependent on the client libraries.  You will also get this error
when the client is installed, but you have failed to set the 
DB2INSTANCE environment variable.  I often put a begin block in 
my DBI programs that use DBD::DB2 to set the environment, as 
follows:

#!/usr/bin/perl -w

BEGIN {
   $ENV{DB2INSTANCE} = q(instname);
}

use DBI;

my ($dbName, $dbUser, $dbWord) = @ARGV;
my $dbh = DBI->connect(qq(DBD:DB2:$dbName), $dbUser, $dbWord);

# etc...

exit;


The quickest way to see if you have the client software installed 
correctly, is to run the db2 program from the command line.  If it
works, your DBI Perl should also work.

Stph

Reply via email to