> If there is a speed improvement, would it be significant?
> 
> It is virtually certain you will see some improvement from preparing
> only once, probably significant.  The only way to know how much is to
> time it a few hundred times each way.
> 

The reason I ask this is:

INIT_FUNCTION
   my $lcsr = $db->prepare(<<EOS) || ataerr::dbprepare($db);
   BEGIN
      STORED_PROC.GET_SERVICE_BY_ID(:service_id, :last_modified,
:base_prod_id, :person_id, :operator_id);   
   END;
EOS
END FUNCTION

In this function, if the database handle is the same, the 'text' of the SQL code is 
static. I am wondering if DBI is internally spotting this and internally caches the 
prepare (i.e. do not send it again to the database). 
If so, I don't expect much performance improvement as I am only optimising a few lines 
of Perl.

Thanks,
Jeroen

Reply via email to