Select to view content in your preferred language

Query builder in Select by Attribute, Definition Query, and other places not working with coded domain values

251
2
03-05-2025 04:47 PM
Labels (1)
MackenzieCollins
Occasional Contributor

Hello,

We are working in ArcGIS Pro 3.4.2.

We added a coded text domain to our hydrants as pictured below.

MackenzieCollins_0-1741221521848.png

After populating the field we are trying to query the hydrants by this domain and the query builder looks as follows.

MackenzieCollins_1-1741221583210.png

This query does not work. The SQL behind the builder is " fire_dist = '1' "

The only way to get the query to work is if I input the domain description as the value to query. So the working SQL is " fire_dist = 'Alta FPD' ".

It would be nice for this to be fixed so we don't have to adjust the drop down values to query data in the builder.

0 Kudos
2 Replies
ChrisUnderwood
Esri Regular Contributor

Hello @MackenzieCollins , if you look in Data Design > Fields, what is the Data Type for your Code field ? Then check whether this matches the Field Type set in your Domain.

Your Code values look like numerics but the SQL seems to be treating it as a text string by using single quotes around it.

fire_dist = '1'

 

0 Kudos
MackenzieCollins
Occasional Contributor

Hello @chrichris . Thanks for the reply!

They are both text.

I changed the value and description in my domain to match and the query now works as expected.

I still don't really understand why the query didn't work though in the first place. Since I used a domain, shouldn't the value of my domain be what is in my field and be what is queried against? Maybe I don't understand domains enough or the differences between using numeric vs text domains.

0 Kudos