This is the script:

#! /usr/bin/perl 

print "Content-type: text/html", "\n\n";
print "<HTML>", "\n";
print "<HEAD>";
print "<TITLE> Testing Team List<TITLE>", "\n";
print "</HEAD>", "\n";
print "<BODY>";

use CGI::Carp qw(fatalsToBrowser);
use DBI;
use strict;

my $dbh =
DBI->connect('dbi:Oracle:','scott','tiger',{RaiseError
=> 1,AutoCommit => 0}) || die "Database connection not
made:$DBI::errstr";

my $sql = qq{select name from project};
my $sth = $dbh->prepare( $sql );
$sth->execute();
my(  $name, $i, $nnn);
$sth->bind_columns( undef,  \$name );
while( $sth->fetch() ) {
 $nnn=$name;
 print " $nnn\n";
}

$sth->finish();
$dbh->disconnect();

print "\n", "</BODY>", "\n\n";
   print "</HTML>", "\n\n";

#end index.pl




This is the Output in the Terminal:

[EMAIL PROTECTED] cgi-bin]$ perl index.pl
Content-type: text/html

<HTML>
<HEAD><TITLE> Testing Team List </TITLE>
</HEAD>
<BODY> name1
 name2
 name3
 name4
 name5
 name6
 name7
 name8
 name9
 name10

</BODY>

</HTML>

[EMAIL PROTECTED] cgi-bin]$

This is the error from the Browser:

Content-type: text/html
Software error:

DBI connect('','scott',...) failed: (UNKNOWN OCI
STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS
settings etc. at /var/www/cgi-bin/index.pl line 12

For help, please send mail to the webmaster
([EMAIL PROTECTED]), giving this error message and the
time and date of the error. 

The NLS_LANG parameter is set to "AMERICAN" which was
previously set as  "AMERICAN"

This is .bashrc:

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
export ORACLE_BASE=/opt/ora9
export ORACLE_HOME=/opt/ora9/product/9.2
export
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=ora9i
export ORACLE_TERM=xterm
export LD_ASSUME_KERNEL=2.4.1
export THREADS_FLAG=native
export
LD_LIBRARY_PATH=/opt/ora9/product/9.2/lib:$LD_LIBRARY_PATH
export PATH=/opt/ora9/product/9.2/bin:$PATH
export NLS_LANG=AMERICAN;








________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and 
more. 
Go to: http://in.insurance.yahoo.com/licspecial/index.html

Reply via email to