#!/usr/bin/perl
use DBI;
use CGI;
#BEGIN{
$ENV{'ORACLE_HOME'}="/opt/oracle/product/10.2.0/client_1";
$ENV{'LD_LIBRARY_PATH'}="/opt/oracle/product/10.2.0/client_1/lib32:/usr/local/lib/sprolib:/usr/local/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/lib:/usr/ucblib";
#$ENV{'TWO_TASK'}='DB';
#}
print "Content-Type:text/html\n\n";
print<<__HTML__;
Test123
__HTML__
my $DB="sampleSID";
my $HOST="DBSERVERNAME";
my $PORT="1521";
my $USER="ms_swan";
my $PASS="ms_swan915";
print "
";
print "Environment variables are:". %ENV;
print %ENV;
print "
";
print "This is before connecting\n";
my $MysqlDbh = DBI->connect("DBI:Oracle:host=$HOST;sid=$DB;port=$PORT",$USER, $PASS, {RaiseError => 0, AutoCommit => 1,PrintError => 1 });
print $MysqlDbh;
if (! $MysqlDbh) {
print "Error Error Error";
}else{
print "Connected";
}
my $Statement="select * from AdditionalNodeInformation where Node = '123'";
my $Sth = $MysqlDbh->prepare($Statement);
if (! $Sth) {
print "Unable to prepare query $Statement.\n$DBI::errstr\n";
exit;
}
if (! $Sth->execute) {
print "Unable to execute query $Statement\n$DBI::errstr\n";
exit;
}else{
print "This query has been executed";
}
print "";