Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Oracle DB

Status
Not open for further replies.

IMAUser

Technical User
May 28, 2003
121
CH
Hi

New to Perl. Am trying to connect to the Oracle db using the following

#!/usr/local/bin/perl
# Name: ConnDb.pl

use DBI;
my $dbh=DBI->connect('dbi:Oracle:MYDBNAME','myusername','mypasswd') or die ;
$dbh->disconnect;

When I run it on the command prompt
$ perl ConnDb.pl

I get

DBI->connect(MYDBNAME) failed: ERROR OCIEnvInit at ConnDb.pl line 5
Died at ConnDb.pl line 5.

Any ideas please.
 
Google got this
Check what you are setting as your ORACLE_HOME environment
ORACLE_HOME='/oracle/product/v9.2.0'
DBD module uses this to locate oracle binaries

Might be worth a look
--Paul
 
include the value of $DBI::errstr in your die message

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top