Home: Perl Programming Help: DBI:
problem with dbi and dbd installation



rajjj
Novice

Jul 28, 2006, 11:00 PM


Views: 5036
problem with dbi and dbd installation

hi all,

there is a problem with connecting oracle db. when i try to establish a connection by a sample script..given below

#use strict;
use Oracle;
#use DBI;


my $dbh = DBI->connect('DBI:Oracle:dsn','scott','tiger') or die "can't connect to the database";

my $sth = $ddh->prepare('select * from emp') or die 'u r dead';;

my $result= $sth->execute();

while(@arr= $result->fetchrow_array()){
$eno = $arr[0];
print $eno;
}



i got the follwoing error..

DBI object version 1.50 does not match $DBI::VERSION 1.51 at C:/Perl/lib/DynaLoader.pm line 253.
BEGIN failed--compilation aborted at C:/Perl/lib/DBI.pm line 259.
Compilation failed in require at C:/Perl/lib/Oracle.pm line 16.
BEGIN failed--compilation aborted at C:/Perl/lib/Oracle.pm line 16.
Compilation failed in require at sqltest.pl line 4.
BEGIN failed--compilation aborted at sqltest.pl line 4.

...

can any body resolve this ...



thanx


davorg
Thaumaturge / Moderator

Jul 31, 2006, 5:25 AM


Views: 5027
Re: [rajjj] problem with dbi and dbd installation

You shouldn't be using a module called Oracle.pm, you should be using DBI.pm.

It sounds like your versions of DBI and DBD::Oracle weren't installed properly. How did you install them?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks