
December 1st, 2003, 02:46 AM
|
|
Junior Member
|
|
Join Date: Dec 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Oracle Perl Help...
I'm trying to write a CGI prog that will search through my database and bring up specific information. So I tested it out on the default table emp and I can get that to work. So I can pass through an employee's and and grab his info. But when I try to get it to work for my specific table, nothing comes up, but I do have a few entries within the table.
So this is the code I use to get to the emp database:
my $sth = $dbh->prepare("
select * from emp where upper(ENAME) = upper('$ename')
" );
$sth->execute()|| die "Oracle connection failed!";
while (my $search = $sth->fetchrow_hashref())
{
print "<TR>";
print "<TD>".$search->{EMPNO};
print "<TD>".$search->{ENAME};
print "<TD>".$search->{JOB};
print "<TD>".$search->{HIREDATE};
print "<TD>".$search->{SAL};
print "\n";
}
print "</TR>\n";
And this the code I use for my database:
my $sth = $dbh->prepare("
select * from shelter where upper(SNAME) = upper('$sname')
" );
$sth->execute()|| die "Oracle connection failed!";
while (my $search = $sth->fetchrow_hashref())
{
print "<TR>";
print "<TD>".$search->{SNAME};
print "<TD>".$search->{CITY};
print "<TD>".$search->{PNUMBER};
}
print "</TR>\n";
I know the parameters coming through are correct because I put in a little print statement and it displays the data coming in. So what am I doing wrong? Are there permissions for databases that I don't know about? Thanks in advance!
-migs
|