This is a quick follow-up to part 1, with a couple more observations about dynamic parameters.
Embedded Apostrophes
Here’s one I can’t believe I forgot to mention the other day: A major ExecuteSQL headache that dynamic parameters can alleviate is the dreaded “embedded apostrophe” problem. In case you aren’t familiar with it, if your text string contains an embedded apostrophe, in standard SQL you must escape it by prepending another apostrophe, for example compare these two “standard” (non-dynamic) queries:
As you might expect, you don’t have to worry about this if you instead use a dynamic parameter… just quote the search term the way you would any FileMaker text string (i.e., in double quotes) and go about your business.
Continue reading “FM 12 ExecuteSQL: Dynamic Parameters, pt 2”