Select to view content in your preferred language

Parameterized/safe queries for QueryTask?

2020
0
10-26-2010 07:51 AM
PaulAbbott
New Contributor
Is there any way to build 'safe' queries with a QueryTask?  The documentation for the WhereClause property says

"A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed, for example: where=POP2000 > 350000"

But sending a where clause as a string built from user input that gets blindly executed seems ripe for a SQL injection attack.  Sure I can sanitize the input but that's a lot of work and could possibly prevent legit queries from being accepted on text fields.
0 Kudos
0 Replies