A
alessandro.lagostena
Hello Gents
I have strange problem with a perl script that query a Oracle DB
I have installed Perl 5.005 +CPAN DBI and driver Oracle on 2 Sun BOX
with Solaris 2.7 and Oracle *
Thoericaly the box have the same configuration
Solaris 2.7
Perl 5.005 + CPAN (Same kit copied from a third )server
jdk 1.2.2
Same unix env
Same Db Oracle
If i run a simple program (see below) for access a oracle db on server
A all work fine BUT on server B i see a stranges message realted the
java env (see below)
#----------------------------------------------------------------------------------------------
#Source code
#!/usr/local/bin/perl
use DBI;
use File::Basename;
use URI::Escape;
my $dbh;
#
$OSNAME=lc($^O); # extract O.S name
if ( $OSNAME eq "mswin32" ) {$DRIVER="ODBC";} # Use ODBC
for solve problem with blobs
else {$DRIVER="Oracle";}
#
# Connect to database
#
$istance="GEWTON01";
$username="wtadmin";
$password="xxx";
#
print "DRIVER=$DRIVER ISTANCE=$istance USERNAME=$username
PASSWORD=$password \n";
#
my $dbh = DBI->connect( "dbi:$DRIVER:$istance",
$username,
$password,
{AutoCommit => 0,
RaiseError => 1,
PrintError => 0 ,
LongReadLen=> 512000 } )
#
or die $DBI::errstr;
#
my $cm ="SELECT TNAME FROM TAB";
&debug ( "cm=$cm" );
my $sth = $dbh->prepare($cm);
$sth->execute;
#
while ( $h_ref =$sth->fetchrow_hashref('NAME_uc') )
{
%table=%$h_ref;
print $table{"TNAME"};
}
#
$sth->finish; # Close the query
#
$dbh->disconnect;
#----------------------------------------------------------------------------------------------
#Result
perl /tmp/provadb.pl
DRIVER=Oracle ISTANCE=WCCOE3 USERNAME=wtadmin PASSWORD=xxx
You must install a Solaris patch to run this version of the Java runtime.
Please see the README and release notes for more information.
I think that the errors appears when the program try to connect at the DB
I have compared the 2 box but seams equals , objvius a difference are
present but i not know where find it
Can someone have some sudgestion about this probelm ?
Thanks for the support
Regards LAGO
I have strange problem with a perl script that query a Oracle DB
I have installed Perl 5.005 +CPAN DBI and driver Oracle on 2 Sun BOX
with Solaris 2.7 and Oracle *
Thoericaly the box have the same configuration
Solaris 2.7
Perl 5.005 + CPAN (Same kit copied from a third )server
jdk 1.2.2
Same unix env
Same Db Oracle
If i run a simple program (see below) for access a oracle db on server
A all work fine BUT on server B i see a stranges message realted the
java env (see below)
#----------------------------------------------------------------------------------------------
#Source code
#!/usr/local/bin/perl
use DBI;
use File::Basename;
use URI::Escape;
my $dbh;
#
$OSNAME=lc($^O); # extract O.S name
if ( $OSNAME eq "mswin32" ) {$DRIVER="ODBC";} # Use ODBC
for solve problem with blobs
else {$DRIVER="Oracle";}
#
# Connect to database
#
$istance="GEWTON01";
$username="wtadmin";
$password="xxx";
#
print "DRIVER=$DRIVER ISTANCE=$istance USERNAME=$username
PASSWORD=$password \n";
#
my $dbh = DBI->connect( "dbi:$DRIVER:$istance",
$username,
$password,
{AutoCommit => 0,
RaiseError => 1,
PrintError => 0 ,
LongReadLen=> 512000 } )
#
or die $DBI::errstr;
#
my $cm ="SELECT TNAME FROM TAB";
&debug ( "cm=$cm" );
my $sth = $dbh->prepare($cm);
$sth->execute;
#
while ( $h_ref =$sth->fetchrow_hashref('NAME_uc') )
{
%table=%$h_ref;
print $table{"TNAME"};
}
#
$sth->finish; # Close the query
#
$dbh->disconnect;
#----------------------------------------------------------------------------------------------
#Result
perl /tmp/provadb.pl
DRIVER=Oracle ISTANCE=WCCOE3 USERNAME=wtadmin PASSWORD=xxx
You must install a Solaris patch to run this version of the Java runtime.
Please see the README and release notes for more information.
I think that the errors appears when the program try to connect at the DB
I have compared the 2 box but seams equals , objvius a difference are
present but i not know where find it
Can someone have some sudgestion about this probelm ?
Thanks for the support
Regards LAGO