There's more than one way to do things | |
PerlMonks |
Re: prepare statement within DBIby dragonchild (Archbishop) |
on Aug 25, 2004 at 15:23 UTC ( [id://385702]=note: print w/replies, xml ) | Need Help?? |
The cost of preparing the statement, while non-zero, usually is effectively zero when compared with the cost of executing the statement.
Additionally, there is the cost of maintaining the code. One prepare() call has traditionally been used for preparing one statement. Breaking that could cause issues when someone else tries to maintain your code. As always, I would suggest trying it out and seeing what happens. The results might surprise us all. Caveat - as with every non-vanilla usage of DBI, this is going to be dependent on the specific RDBMS you're going to be using. You have been warned. ------
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose I shouldn't have to say this, but any code, unless otherwise stated, is untested
In Section
Seekers of Perl Wisdom
|
|