Ah yes, there was a bug in DBD::Oracle. I forget which version numbers, you can add my 
$foo =
$sth->{NAME} before the $sth->execute which will start the caching.  Which version
of DBD::Oracle are you using?


  

     .. Not that this affects performance, but you can set your sql by,

      my $sql = qq{ select target, to_char(timestamp, 'YYYY-MM-DD HH:MI:SS')
                    from reports_generated
                    where data_date = to_date($data_date, 'YYYYMMDD') };

      ..try this for performance,

      my $sth = $dbh->prepare($sql);
     
      $sth->execute; 
      $sth->bind_columns(\($target, $time);

      while ($sth->fetch) {
          # the variables are filled at this point. 
      }


>     #print "\n$sql\n";
> 
>     $sth=$dbh->prepare($sql);
>       print localtime()." - SQL prepared\n";
>       DBI->trace_msg("\n".localtime()." - SQL Prepared\n\n");
> 
>     $sth->execute;
>       #$return = $sth->fetchall_hashref('TARGET',);
>       $return = $sth->fetchall_arrayref;
> 
>       print localtime()." - Executed\n";
>       DBI->trace_msg("\n".localtime()." - Executed\n\n");
> 
>       &log("    STH Error : ".$sth->err);    
>       &log("    DBH Error : ".$dbh->err);
>       &log("    DBH State : ".$dbh->errstr);
> 
>       print localtime()." - return $return\n";
> 
> 
>       $result_count = @{$return};
>     print localtime()." - Found $result_count result\n";
>       DBI->trace_msg("\n".localtime()." - Returned $result_count
> records\n\n");
> 
>       $i=0;
>       foreach $target (@{$return}){
>               $i++;
> 
>               #print "$i - ".${$target}[0];
>               #print " - : ${$target}[1]";
>               #print " - bar: ".(keys %{$foo});
>               #print " - bar: ".(${$foo}{0});                         
>               #print "\n";
> 
>       }
> 
>       $sth->finish;
>       DBI->trace_msg("\n".localtime()." - sth released\n\n");
> 
>       print localtime()." - Returned $i records\n";
> 
> $rc = $dbh->disconnect;
> 
> print localtime()." - Finished\n";
> 
> 
> exit;
> 
>##################################################
> 
> sub numerically {
> 
># An ascending sort routine
> 
>     $a <=> $b
> 
> }
> 
>##################################################
> 
> sub descending {
> 
># An ascending sort routine
> 
>     $b <=> $a
> 
> }
> 
> 
>##################################################
> 
> sub log{
>  
>     print "$_[0]\n";
> 
> 
> 
> }
> 
> 
> 

----------------------------------
E-Mail: [EMAIL PROTECTED]
Date: 03-Oct-2002
Time: 10:31:09
----------------------------------

Reply via email to