Select to view content in your preferred language

Definition query not being honored

3323
5
Jump to solution
08-16-2021 08:58 AM
Labels (3)
JoeBorgione
MVP Emeritus

ArcGIS Pro 2.7.3

I am unable to get a definition query to work at all.  No matter what attribute I try or value(s) it just isn't honored:

JoeBorgione_0-1629129102443.pngJoeBorgione_1-1629129182465.png

I can create a selection query and that works:

JoeBorgione_2-1629129285897.png

Is this a known problem in 2.7.3?  I'm planning on an update to 2.8.2 today.  Maybe I'll do that sooner than later....

That should just about do it....
0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Are you using the Pro SDK to define the 'definition query'?  You should see on the bottom of the dialog the current active 'definition query', as shown on the screen shot below.  Can you share what RDMS you are using and also a sample of you 'definition query' in sql format?  If you use the Pro SDK can you share a code snippet for your 'definition query'?  

Wolf_0-1629132401862.png

 

View solution in original post

5 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Are you using the Pro SDK to define the 'definition query'?  You should see on the bottom of the dialog the current active 'definition query', as shown on the screen shot below.  Can you share what RDMS you are using and also a sample of you 'definition query' in sql format?  If you use the Pro SDK can you share a code snippet for your 'definition query'?  

Wolf_0-1629132401862.png

 

BrettJenkinson
Emerging Contributor

I'm having this same issue but this solution did not work. The query box says that my query is active, yet it is showing other data within the layer that clearly do not fit the specified query. My select by attribute option also functions properly. Not sure what the issue is.

Wolf
by Esri Regular Contributor
Esri Regular Contributor

Can you provide the version of Pro you're using, a screenshot of the SQL Query that is not working, and sample of the rows that are displayed (use the Attribute table for that) even so they don't fulfill the query condition?

0 Kudos
DorianneDysart
Occasional Contributor

ditto

Strangely I was able to get it to work after I made a feature class copy of the layer and applied a definition query to the new layer.  The original layer then updated.

The layer I was working with was actually a feature service, so I was not sure if there was a setting from the enterprise portal that was somehow overriding the definition query.

I am using ArcGIS Pro 3.0.2

0 Kudos
JoeBorgione
MVP Emeritus

OMG that's embarassing....  😖

That should just about do it....
0 Kudos