hi i am new in perl and i am trying to query a table in oracle db. I would like for help in debgging my script. I've tried executing the same SQL statement in TOAD and it works just fine, but when I try to execute it using perl no rows are being returned. Below is the code $SQL = "SELECT $columns FROM $tbl WHERE $col_cond $val_cond AND $date_col <= SYSDATE - NUMTODSINTERVAL($ll,'HOUR') AND $date_col >= SYSDATE - NUMTODSINTERVAL($ul,'HOUR')"; my $sth = $dbh->prepare($SQL) or die "prepare failed: ". $dbh->errstr(); $sth->execute; while (row = $sth->fetchrow()) { $line = join(",", row), "\n"; ...
hi i am new in perl and i am trying to query a table in oracle db. I would like for help in debgging my script. I've tried executing the same SQL statement in TOAD and it works just fine, but when I try to execute it using perl no rows are being returned. Below is the code
$SQL = "SELECT $columns FROM $tbl WHERE $col_cond $val_cond AND $date_col <= SYSDATE - NUMTODSINTERVAL($ll,'HOUR') AND $date_col >= SYSDATE - NUMTODSINTERVAL($ul,'HOUR')";
my $sth = $dbh->prepare($SQL) or die "prepare failed: ". $dbh->errstr();
$sth->execute;
while (row = $sth->fetchrow())
{
$line = join(",", row), "\n";
print "$line\n";
}
$sth->finish();
Thank you in advance for the help![]()
Bookmarks