Hi Deven,

Thank you for the previous reply. Driver issue has been resolved. But I am 
getting a new error, as below,

Error:
DBI connect('database=XXXXX:Hostname=10.94.XX.XX:Port=XXX','XXXXXX',...) 
failed: ERROR OCINlsEnvironmentVariableGet(OCI_NLS_CHARSET_ID) Check NLS 
settings etc. at E:\testcon.pl line 22.
ERROR OCINlsEnvironmentVariableGet(OCI_NLS_CHARSET_ID) Check NLS settings etc. 
at E:\testcon.pl line 22.

I have enclosed my script here. Also, I have enclosed the screenshot of the 
error. Please check them out.

Please assist me in this regard.

Regards,
Rakesh R

From: Deven T. Corzine [mailto:de...@ties.org]
Sent: Friday, February 3, 2017 7:12 AM
To: Rakesh Ramachandran <rr00440...@techmahindra.com>
Cc: dbi-dev@perl.org
Subject: Re: DBI ORACLE ERROR

The error message is telling you the problem.  You need to install the 
DBD::Oracle module:

     https://metacpan.org/pod/DBD::Oracle

This is the database driver which allows DBI to talk to Oracle.  If you look at 
the list of available drivers in the error message, Oracle wasn't among them.

Note that you will need to have the Oracle client libraries installed before 
you try to build this module.

Deven


On Thu, Feb 2, 2017 at 12:42 AM, Rakesh Ramachandran 
<rr00440...@techmahindra.com<mailto:rr00440...@techmahindra.com>> wrote:
Hi Perl team,

I have been learning Perl scripting for a while. When I am trying to connect to 
oracle DB, I am getting the following error.

I am using Padre IDE forscripting. I am using Perl 5, version 14, subversion 2 
(v5.14.2) built for MSWin32-x86-multi-thread.

Please help me out for solving the issue.

I have also attached the screenshot of the actual Perl command line for your 
reference.

Error:
install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC 
contains: C:/Dwimperl/perl/site/lib C:/Dwimperl/perl/vendor/lib 
C:/Dwimperl/perl/lib .) at (eval 4) line 3.
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right.
Available drivers: ADO, DBM, ExampleP, File, Gofer, ODBC, Pg, Proxy, SQLite, 
Sponge, mysql.
at dbscriptfororacle.pl<http://dbscriptfororacle.pl> line 30
Press any key to continue . . .

Regards,
Rakesh R

________________________________
============================================================================================================================
Disclaimer: This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html externally 
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.
============================================================================================================================

============================================================================================================================

Disclaimer:  This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html 
<http://www.techmahindra.com/Disclaimer.html> externally 
http://tim.techmahindra.com/tim/disclaimer.html 
<http://tim.techmahindra.com/tim/disclaimer.html> internally within 
TechMahindra.

============================================================================================================================

Attachment: testcon.pl
Description: testcon.pl

#!/usr/bin/perl

use DBI;
use strict;

#
# ( my $sec,my $min,my $hr,my $mday,my $mon,my $year) = localtime(time);
#$mon++;
#$year += 1900;

my $driver = "Oracle"; 
my $database = "XXXXX";
my $userid = "XXXXXX";
my $hostname = "10.94.XX.XX";
my $port = "XXX";
my $password = "XXXXXXX";
my $dsn = "DBI:$driver:database=$database:Hostname=$hostname:Port=$port";




my $dbh = DBI->connect($dsn, $userid, $password ) or die $DBI::errstr;

$dbh->{LongReadLen} = 65535; 
$dbh->{PrintError} = 0;  

print "COnnection successful....\n";

Reply via email to