Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

Definition queries

An important property of Layer objects is the ability to dynamically set definition queries. A definition query is a SQL statement where clause that limits the data available for display, query, or other data operations (buffers, intersections, etc.) to only the rows that match the where clause. Definition queries could be set in an MXD by opening a layer's properties menu and using the Definition Query tab, but here we are concerned with how to add them programmatically. Following is an example of how to do this: