It's been a while since I've used DBI, and I didn't bother with the docs, so some sub names (such as $dbh->execute()
) or arguments (such as $dbh->prepare()
) may be wrong, but the general gist is there.
Another potential way to crack the nut, if you're not making too many queries and/or you're using this one particular query a bunch, is to prepare the statement once, à la bind_2.pl
, and then ever free()
it, which means the legwork of parsing the SQL is already done, and you can just stick in some new parameters as necessary, and not necessarily have to worry about quoting them.