Re: Problem in connecting the DB



On 04/21/2005 06:46 AM, jagatheesh.ramakrishnan@xxxxxxx said:

I am facing poblem in connecting a database thru perl program

Here are the details about the packages which i installed in my Windows machine
....
ppm> describe dbd-oracle
=======================================================================
Name: DBD-Oracle
Version: 1.12
Author: Tim Bunce (dbi-users@xxxxxxxx)
Title: DBD-Oracle
Abstract: Oracle database driver for the DBI module
Location: ActiveState Package Repository
Available Platforms:
1. MSWin32-x86-multi-thread
===========================================================================
ppm> describe dbi
 Name: DBI
 Version: 1.48
 Author: Tim Bunce (dbi-users@xxxxxxxx)
Title: DBI
Abstract: Database independent interface for Perl
Location: ActiveState PPM2 Repository
Available Platforms:
       1. MSWin32-x86-multi-thread-5.8
====================================================================================================================
Script which i was trying to run:

use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:oracle:tar',
'scott',
'tiger',
) || die "Database connection not made: $DBI::errstr";
$dbh->disconnect;
While running the above script i am getting the following error


C:\>perl "C:\Documents and Settings\Administrator\Desktop\connect.pl"
install_driver(oracle) failed: Can't locate DBD/oracle.pm in @INC (@INC contains
: C:/Perl/lib C:/Perl/site/lib .) at (eval 1) line 3.
Perhaps the DBD::oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'oracle' isn't right.
Available drivers: DBM, ExampleP, File, ODBC, Proxy, Sponge.
at C:\Documents and Settings\Administrator\Desktop\connect.pl line 3

The problem is exactly what it says (perhaps the capitalisation of 'oracle' isn't right), you don't have DBD::oracle installed. The correct DSN string is "dbi:Oracle:tar". Note the capital 'O'.


--
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
.



Relevant Pages

  • RE: ORACLE DRIVER
    ... DBI - is the perl module to handle all the request of the database, connecting, disconnecting, routing the database request to proper driver. ... DBD::Oracle - is the Oracle driver that DBI can use to handle oracle request. ...
    (perl.dbi.users)
  • Re: DBI with ORACLE encryption
    ... perl script to pull data out of the interface and dump the same to the ... All we do with oracle is to take an database connection ... other ways of connecting to database using dbi. ...
    (perl.dbi.users)
  • RE: Generic DBI question about backups
    ... You could open two dbi handles, ... Oracle db and the other to a csv db. ... My big problem is that the new database hasn't been selected yet & the ...
    (perl.dbi.users)
  • DBD::Oracle 1.12 & Oracle 8.1.6: Unable to connect
    ... We have been using DBD::Oracle 1.12 with DBI 1.42 on Tru64 UNIX quite ... we are unable to connect to an Oracle 8.1.6 database under ... On another Tru64 box, running DBI ...
    (perl.dbi.users)
  • RE: oracle win2k ORA-1222 problems
    ... AS does not provide a package, but you can and should install both DBI and DBD::Oracle from ftp.esoftmatic.com. ... Oracle is listed as "failed" if I recall correctly. ... Data Source is DBI:Oracle:Space ...
    (perl.dbi.users)