If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > Problem in accessing Database through PERL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-05, 06:50
Poonam Sachdeva Poonam Sachdeva is offline
Registered User
 
Join Date: Dec 2005
Posts: 1
Problem in accessing Database through PERL

Hi
I am new to PERL.I have started writing a few programs but when i tried to connect to the database using PERL using the below code
#!/usr/local/bin/perl
use DBI
my $dbh = DBI->connect("dbi:Oracle:BAUp01","pan","panbau")||
die "can't connect to the database $DBI::errstr\n"
I got the following error

Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.0/sun4-sola
ris /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) at dbase
.pl line 3.
BEGIN failed--compilation aborted at dbase.pl line 4.

PLease let me know what is the solution

Other info
perl -v

This is perl, v5.8.0 built for sun4-solaris

Copyright 1987-2002, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
OS_NAME=SunOS
OS_VERSION=5.6
$ version
Machine hardware: sun4u
OS version: 5.6
Processor type: sparc
Hardware: SUNW,Ultra-4

The following components are installed on your system:


Sun WorkShop Professional C 5.0
Sun WorkShop Compiler C 5.0
Sun WorkShop IPE 5.0
Sun WorkShop Dbx 5.0
Sun WorkShop Performance Analyzer 5.0
XEmacs 20.4 Source Distribution

Sun WorkShop FileMerge 3.1


Please give me a solution
Thanks
Poonam Sachdevaundefinedundefined
Reply With Quote
  #2 (permalink)  
Old 01-23-06, 13:27
hyperbole hyperbole is offline
Registered User
 
Join Date: Jan 2006
Posts: 32
You need to download the DBI module. Run cpan on your machine and tell it to install DBI.



.
Reply With Quote
  #3 (permalink)  
Old 02-02-06, 23:27
reneeb reneeb is offline
Registered User
 
Join Date: Jan 2004
Location: Germany
Posts: 167
Just installing DBI is not enough, you will also need the driver for Oracle which is DBD::Oracle

perl -MCPAN -e 'install DBI'
perl -MCPAN -e 'install DBD::Oracle'
__________________
board.perl-community.de - The German Perl-Community
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On