DBI/DBD::DB2



Hello,
I am trying to write a perl script to connect to our DB2 database and
do some basic SQL queries. But I'm having trouble with making
everything play nice.
I'm on WinXP, and did a manual build of DBI with Visual Studio's
nmake. That all went fine (as far as I can tell). So I downloaded the
DBD::DB2 module and unzipped it to my C:/Perl/lib directory (creating
the blib directory from the use lib line below. Here's the code I'm
trying to test it with...

use lib 'c:/Perl/lib/blib/lib/Bundle';
use DBI;

### Probe DBI for the installed drivers
my @drivers = DBI->available_drivers();

die "No drivers found!\n" unless @drivers; # should never happen

### Iterate through the drivers and list the data sources for
### each one
foreach my $driver ( @drivers ) {
print "Driver: $driver\n";
my @dataSources = DBI->data_sources( $driver );
foreach my $dataSource ( @dataSources ) {
print "\tData Source is $dataSource\n";
}
print "\n";
}


And here is the output:

DBD::DB2 initialisation failed: Can't locate object method "driver" via
package "DBD::DB2" at c:/Perl/site/lib/DBI.pm line 768.

Perhaps the capitalisation of DBD 'DB2' isn't right. At
C:..........dbQueryAutoBatch.pl line 33.


Not sure if DBI or DBD::DB2 arne't right or I'm just calling something
wrong. But any help would be appreciated.

Thanks,
KW



Kevin Wendt
Summer Project Intern
Cell: 612-209-2022
Email: Kevin.D.Wendt@xxxxxxxxxxxxxx

This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation



Relevant Pages

  • Re: DBI v2 - The Plan and How You Can Help
    ... >>that Perl + DBI needs to work with. ... > occasisionally greatly insane) drivers that do strange and wonderful things. ... > I have an increasing suspicion that having open design processes like ... Perl6 features - especially as it would have helped kick-start my own ...
    (perl.dbi.users)
  • RE: $sth->{NAME} doesnt work
    ... Jayson Pifer - Thanks for pointing out that you need to execute() a ... surprising since the column labels can be determined without seeing the ... For DBI, ... Perhaps this will mean drivers ...
    (perl.dbi.users)
  • Re: Configure DBI logging to be more specific.
    ... (In theory all drivers are meant to enbale ShowErrorStatement by ... default, unless they have a good reson not to, such as a better ... I am using DBI and relativly new to it. ...
    (perl.dbi.users)
  • Re: most drivers share error variable for sth/dbh handles?
    ... "The DBI resets $h->err to undef before almost all DBI method calls, so the value only has a short lifespan. ... Given the "most drivers" above I presume some drivers don't share the error variable for database and statement handles. ...
    (perl.dbi.users)
  • Re: how to "spell out" the elements in a scalar variable?
    ... > I'm using DBI to retrieve data from a DB2 database for each column in a ... > from the database, and after executing the above routine, the value in ...
    (comp.lang.perl.misc)