Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Perl & Oracle

Re: Perl & Oracle

From: Jenn-Han Lien <jhlien_at_freeway.tem.nctu.edu.tw>
Date: 13 Dec 1999 05:04:19 GMT
Message-ID: <831uoj$qbl$1@news2.nctu.edu.tw>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US