Domain Code and Description Attribute Query Problem

2159
5
07-20-2013 07:34 AM
TimHayes
Occasional Contributor III
I added a Domain to the Location Field in our Abandoned Pipes Feature Class. When I go to Select By Attributes, choose Location field, and unique attribute, I am seeing the field values derived from the Domain. But, I also see the Domain Code and Description shown like this:

Buried
Bur - Buried

Why is the Code shown alone, then Code and Description shown together? not for all the values, just the buried. This problem also occurs with different domains across all my Feature Classes. I would assume that the values shown should all be either the Code OR the Description, not a mix of the two.

When I choose "Buried" it selects all the records, but 4. When I choose "Bur - Buried" it selects only 4 records. I checked the field values in the attribute table and they all show the Description (Buried). I then switched to have them show the code, and they show "Bur".

The problem is only with this one Domain Code, the other Codes and Descriptions are ok.

See the attached screen capture for a better explanation.


I am using ArcGIS Desktop Advanced 10.1, ArcGIS Server Enterprise Standard 10.1, ArcSDE 10.1, SQL Server Express 2008 R2.

I have not installed 10.1 SP1.
0 Kudos
5 Replies
CoryWilliams
Occasional Contributor II
Hi Wolseley,
Whenever I do a Select by Attributes or Definition Query, I always see the [Domain Code] - [Domain Value].
I was wondering, is it possible to get a screenshot of your Coded Domain list? The answer might be there?

The codes for the other domains, they aren't the same as the value by any chance are they?

Cheers,

Cory
0 Kudos
TimHayes
Occasional Contributor III
Hi Wolseley,
Whenever I do a Select by Attributes or Definition Query, I always see the [Domain Code] - [Domain Value].
I was wondering, is it possible to get a screenshot of your Coded Domain list? The answer might be there?

The codes for the other domains, they aren't the same as the value by any chance are they?

Cheers,

Cory


The codes for the domains are different than the domain description.

Here are some screenshots of our Location Domain. This is one of them that is giving me problems.
0 Kudos
AprilChipman1
New Contributor II

I am having this same problem in ArcMap 10.2.2. Did you ever find a solution?

Thanks,

April

0 Kudos
TimHayes
Occasional Contributor III

Nope. The problem is still there. Not sure if ESRI will ever fix it or if it is even possible to fix.

0 Kudos
RichardFairhurst
MVP Honored Contributor

Are you sure all of the values in the field actually match your codes?  If someone uses the Field Calculator on the field they could insert the domain description into the field directly and not the code, bypassing your domain restriction.  The Field Calculator does not validate itself for any domain.  These values would have no code and would only show the full value that is not in your domain.  Only entries that actually were put in the field by the Domain drop down or that were calculated with valid domain codes would appear in the list as both a code and a description.  So if a person calculated "Buried" into the field and the field allowed enough characters for that value, it would be inserted into the field without an error, despite the fact that only "Bur" is in the Domain to represent Buried and not the full word "Buried" that they just inserted.  Another way this could have occurred is if you applied a Domain to a field that had the full description values spelled out and you did nothing to make them comply with your new domain codes before applying the domain.  The fact that those existing values are not part of the Domain will not prevent you from applying the Domain, nor will it change the non-compliant values to comply with your domain.

You can find out if invalid values have been calculated into a domain controlled field by using the Validate Features option in the Editor menu.  Also see the Validating features section and other aspects of domains in this help topic.  Another way to see the invalid values and clean them up is to remove the domain and look at the raw values.  If you actually see "Buried" then that value has to be changed to the "Bur" code as well as any other values that are not actually codes in the domain you are trying to apply.

The problem with using the Field Calculator is that there is no easy way to know what the codes actually are when calculating values into a domain controlled field from the Field Calculator dialog itself.  You have to open the Select by Attribute dialog and get unique values for the field to see the code you are supposed to calculate into the field.