Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Why use prepare_cached?
It is mainly of use when you have a few statements, that you execute often, but where you are unable to hold a reference to the $sth. And it is only usefull if the driver supports it. (Not all drivers do presently). You should also note that for some databases prepared statements and placeholders take more time than just $dbh->do'ing the statement with values in place. With those databases the only advantage of placeholders is that you don't have to do quoting - which is a big advantage in this situation, as we don't beforehand know the type of the columns, whether numeric or string. And yes that does make a big difference - some databases refuse to accept numbers in quotes as numbers! In reply to Re: Re: A more elegant solution?
by htoug
|
|