in reply to Re: Perl style/best practice question: how to [better] embed SQL in code ?
in thread Perl style/best practice question: how to [better] embed SQL in code ?
Of course, I'll end up with a unique statement nearly each time through, so preparing becomes useless...
I don't get what you mean by "useless" -- preparing is never useless. It's kind of mandatory, esp. when using placeholders, which should be "whenever possible". Even if you think you won't create the same SQL statement more than once in a given run, you can still use:
That's quite painless, and if you happen to come up with the same statement more than once, you'll just get the same handle you got the last time you prepared that statement.my $sth = $dbh->prepare_cached( $sql_statement );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl style/best practice question: how to [better] embed SQL in code ?
by puudeli (Pilgrim) on Dec 17, 2008 at 10:57 UTC |