Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Perl & Oracle
NJN (ibm_97_at_yahoo.com) wrote:
: How can I display a result from a "select" SQL statement in Perl? Such
: as, 'select name from table'.
: $sth->do() doesn't work. Any help? Thnx!
this is a example file:
use DBI;
my $dbh=DBI->connect("$oracleHost","$db_usr","$db_pwd","Oracle",{RaiseError=>1,AutoCommit=>0});
unless ($Application->{'HealthNewTotalNumber'}) {
$sth=$dbh->prepare("select count(FILEID) totalnum from HEALTHNEWS");
$sth->execute();
if ($hash_ref=$sth->fetchrow_hashref) {
$Application->{'HealthNewTotalNumber'}=$hash_ref->{'TOTALNUM'};
}
}
$dbh->disconnect;
--
Shock Lien
Received on Sun Dec 12 1999 - 23:04:19 CST