Help writing a Python script to validate use domains (in ArcGIS 10)

Discussion created by umpierre on Sep 19, 2012
Latest reply on Aug 10, 2016 by harshal.gharat
Ok, I could help coming up w/ best way to write a python script to identify tables fields that violate domain values. I got over 100 feature classes using about 60 domains in a file geodatabase to check. My feature classes are NOT using subtypes (nor am I planning to use that in the near future).

Here are my limitiations:
> No, we can't afford Data Reviewer extension at this time (which I know has functionality to do this).
> I'm still in ArcGIS 10 and it doesn't look like my organization will upgrade to 10.1 until "maybe" early 2013.
> No, using ArcSDE is not an option at this time. (Nor does our IT group allow me to use personal SQL server instances). So, I'm stuck with using File geodatabases and my geodb is too big for a personal (Access) geodb.

Below are some of thoughts, but I'm wondering if there's something simpler I could do.
> I already generated a script that exports all the domains to tables in a file geodb. Ex. a domain called CodeStatus is exported to a table called "tb_CodeStatus". (Let's say these are my lookup tables).
> I could generate a table that stores the feature class, field and domain being used. )Let's pretend I did that and the table is called "tb_DomainUsage").

I'm just not sure what's the best way to do what I want next.
> Should I cycle thru each row in the tb_DomainUsage table, run something like the Frequency tool to create a temp table to store the unique values and then use that temp table to see if any of those values do NOT exist in the corresponding lookup table for that domain? And store the validation check results in another table, similar to the tb_DomainUsage table, but listing the domain values that did not match?
> Other ideas.. My idea above seems like a lot of steps to try come up w/ gp tool that I wish ESRI had thought of in the first place.