FW: Build dbd::oracle for both Oracle 8.x And Oracle 9.x

FW: Build dbd::oracle for both Oracle 8.x And Oracle 9.x

Post by KhatirSaiy » Sun, 08 May 2005 09:22:30


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: XXXX@XXXXX.COM ]
Sent: Sunday, May 01, 2005 6:00 AM
To: Saiyed, Khatir
Cc: XXXX@XXXXX.COM
Subject: Re: Build dbd::oracle for both Oracle 8.x And Oracle 9.x


On 04/30/2005 10:33 PM, Saiyed, Khatir said:


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.yqcomputer.com/ ~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.
 
 
 

FW: Build dbd::oracle for both Oracle 8.x And Oracle 9.x

Post by mchas » Sun, 08 May 2005 10:40:33

On 05/06/2005 05:22 PM, Saiyed, Khatir said:


You can connect to 8.1.7 instances using a DBD::Oracle compiled with
9.2.0, but ORACLE_HOME and the related environment variables ___MUST___
point to an Oracle installation of the version DBD::Oracle was built with.

Look at what I said in my previous email to you.

...

--
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.yqcomputer.com/ ~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.