On Dec 17, 2006, at 4:26 AM, H.Merijn Brand wrote:
my $sth = $dbh->prepare (qq;
select foo, bar
from baz
where duh = ?;
);
BAD idea, because semicolons are semantically meaningful in SQL. As
soon as you have a more complex block you're hosed. And since double
quotes are rare in SQL (you only need them when you're using a keyword
as a literal, which is a bad idea all round) plain strings work better.
set sql "
SELECT foo, bar
FROM baz
WHERE duh = ?;
"
If you can't do that in your favorite language, then perhaps it
shouldn't have blindly borrowed C string syntax.