Did you notice that my version has two separate statement handles that are being executed? You can do the same thing with yours. Prepared statements with placeholders will likely be faster than constructing queries on the fly and executing them, and certainly much safer.
How many possible queries can you need to construct that you can't afford to use prepared statements and placeholders?
In reply to Re^3: Dynamic SQL
by bitingduck
in thread Dynamic SQL
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |