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: 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)
  • User switching and Email
    ... way we can differentiate e-mails and still use this long time e-mail address? ... Tim ... Prev by Date: ...
    (microsoft.public.windowsxp.basics)
  • Re: Sample photo
    ... I'm a chicken when it comes to gambling, so "careful" is my ... Tim H ... Prev by Date: ...
    (rec.motorcycles.dirt)