Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Validate Query?

$
0
0
Has anyone ever noticed that the layer.definitionQuery property will just blindly assign anything you give to it, even if its an invalid query?

Example:
This is an invalid query. The FIELDNAME should be in quotes.
Code:

lyr.definitionQuery = "FIELDNAME = 'VALUE'"
This is a valid query:
Code:

lyr.definitionQuery = "'FIELDNAME' = 'VALUE'"
Does anyone know of a method to validate the query before blindly applying what could be an invalid query?

Viewing all articles
Browse latest Browse all 2485

Trending Articles