0 Replies - 9829 Views - Last Post: 28 July 2006 - 11:46 PM

#1 rajjj   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-July 06

how to connect oracle db using perl script

Posted 28 July 2006 - 11:46 PM

hi
im trying to connect db (oracle 8i) using the following sample code,

#!/usr/bin/perl


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;
}

im getting the following 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 sqltest.pl line 5.
BEGIN failed--compilation aborted at sqltest.pl line 5.

im new to perl. can u help me how to install the modules related to this issue.

thanx in advance

Is This A Good Question/Topic? 0
  • +

Page 1 of 1