6

I'm trying to delete domain, but i can't because it is in use at an attribute domain. How can I find out at which layer and which subtype ? I have a big geodatabase with more than 30 layers an each one have few subtypes ?

2 Answers 2

6

There is a number of toolboxes that let you work with the geodatabases (analyze feature classes, compare workspaces, etc). The toolboxes can be downloaded from here. You can reuse some of those tools in your work. The easiest way to list the fields and see what domains are used (you need to delete domains from fields first before you will be able to delete domains itselves as you realized already) is to use a simple Python code which I copied from another post at GIS.SE:

import arcpy

#Set workspace environment to geodatabase
arcpy.env.workspace = your_gdb

#Get list of feature classes in geodatabase
FCs = arcpy.ListFeatureClasses()

#Loop through feature classes in list
for FC in FCs:

    #List fields in feature class
    fields = arcpy.ListFields(FC)

    #Loop through fields
    for field in fields:

        #Check if field has domain
        if field.domain != "":

            #Print feature class, field, domain name
            print FC, field.name, field.domain
2

For Oracle/SQL Server, you can run select statement(s):

ArcGIS 10.0

ArcGIS 10.1

2
  • Thanks for your fast answer Jay Cummins, I'm using File GDB on arcgis desktop version and with out external database. Commented Oct 10, 2013 at 19:44
  • 1
    I don't have one handy, but someone will probably answer with a python script. You could probably tweak this one: nodedangles.wordpress.com/2011/03/14/… Commented Oct 10, 2013 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.