On Sat, Dec 17, 2005 at 01:19:30AM -0500, David Manura wrote:
> Why do the higher-level DBI methods such as selectall_arrayref() 
> internally use prepare() rather than prepare_cached()? or at least why 
> is there no option to enable that?

You can, in a way:

        $sth = $dbh->prepare_cached($sql);
        $data = $dbh->selectall_arrayref($sth);

or
        $data = $dbh->selectall_arrayref( $dbh->prepare_cached($sql) );

> It seems that the only way to 
> utilize DBI's internal statement handling caching is to directly call 
> prepare_cached(), but managing that is not as convenient or transparent 
> as just using the higher-level methods such as selectall_arrayref().

I think the options above strike a reasonable balance. (Especially as
you're the first person to ask about it here for a long time.)

Tim.

Reply via email to