I have build DBD::Oracle for 9.2.0 and works good on target Oracle 9.2.0 but
when I try to connect to 8.1.7 I get following error:
DBI connect('','lut',...) failed: ERROR OCIEnvNlsCreate (check ORACLE_HOME
and NLS settings etc.) at
dbi8.pl line 11
Help is appreciated.
Thanks
Khatir
The script dbi8.pl is as below:
================================================================
#!/usr/bin/perl
use DBD::Oracle;
use DBI;
use strict;
$|++;
BEGIN {
$ENV{ORACLE_HOME} = '/opt/app/oracle/product/8.1.7';
$ENV{TWO_TASK} = 'forest.test';
}
my $dbh=DBI->connect('dbi:Oracle:','lut','n1cgi21db',
{RaiseError=>1, PrintError=>1,AutoCommit=>0})
or die "connection failed:", $DBI::errstr;
my $sth=$dbh->prepare(qq{select sysdate from dual});
$sth->execute;
my $row;
while($row=$sth->fetch){
print @$row,"\n";
}
$sth->finish;
$dbh->disconnect;
====================================================================
-----Original Message-----
From: Michael A Chase [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 01, 2005 6:00 AM
To: Saiyed, Khatir
Cc: [email protected]
Subject: Re: Build dbd::oracle for both Oracle 8.x And Oracle 9.x
On 04/30/2005 10:33 PM, Saiyed, Khatir said:
> Can I build single dbd::oracle to work with both Oracle 8.1.7 and
> Oracle 9.2.0 running on the Server (Solaris 8) ? If yes, how ? If
> not, any other better means to acheive this.
DBD::Oracle is built for a particular API, Oracle 8.1.7 or 9.2.0 in your
case, and you must have ORACLE_HOME and the other associated variables
pointing to an installation of that version when you run your perl script.
That said, the actual connections to instances are normally made via
SQL*Net which will connect to instances of either version.
I recommend you build DBD::Oracle with the Oracle 9.2.0 API.
--
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.
********** Confidentiality Notice **********
This electronic transmission and any attached documents or other
writings are confidential and are for the sole use of the intended
recipient(s) identified above. This message may contain information
that is privileged, confidential or otherwise protected from disclosure
under applicable law. If the receiver of this information is not the
intended recipient, or the employee, or agent responsible for delivering
the information to the intended recipient, you are hereby notified that
any use, reading, dissemination, distribution, copying or storage of this
information is strictly prohibited. If you have received this information in
error, please notify the sender by return email and delete the electronic
transmission, including all attachments from your system.