Re: prepare_cached() unused in selectall_arrayref() et al



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.
.



Relevant Pages

  • Re: open letter to James Douglas Morrison
    ... >> Look, Tim, here's how this works. ... >> Make sure you are right before you go around criticizing and, generally, ... Oh yeah, Strike 3, you're out. ... Prev by Date: ...
    (rec.sport.officiating)
  • Re: I ought to be a writer (I think)...
    ... Tim S wrote: ... requirement to drink water exactly 11 fl oz at a time doesn't strike me as healthy ... ... I'm in the cast of a June amateur Renaissance faire. ...
    (rec.arts.sf.composition)
  • Re: Copy Record With VBA (Access 2000)
    ... taking bad design decision in the name of trying to ... "keep things simple" usually ends up in far more complication and error. ... Tim F ... Prev by Date: ...
    (microsoft.public.access.modulesdaovba)
  • Ctrl-Shift-F showing deleted methods from old image, which Ctrl-. doesnt
    ... weeks ago in another image (although they might exist in Sts?). ... Tim ... Prev by Date: ...
    (comp.lang.smalltalk.dolphin)
  • Re: TGFITW?
    ... Thanks for proving him up to be a liar. ... Ronnie the Tim ... Prev by Date: ...
    (uk.sport.football.clubs.rangers)