Tools that honor the Maintain fully qualified field names environment use this setting to distinguish between qualified and unqualified field names. Qualified field names are the names of fields in a feature class or table that have the name of the origin feature class or table appended to the field name. This setting is relevant when working with joined data.
- The default qualified output table field naming structure is tableName.fieldName. When unqualified, the fields in the output table or feature class will always be named with the format fieldName.
- In instances in which qualified field names may exceed the allowed field name width, set the environment to unqualified, for example, when joining shapefiles. Shapefile fields are truncated at eight characters.
- When field mappings are included in a tool's parameters, as they are in many tools in the Conversion toolbox, field names are automatically unqualified, so it is not necessary to set this environment.
- Checked—The output field name will include the table name. This is the default.
- Unchecked—The output field name will not include the table name.
arcpy.env.qualifiedFieldNames = qualified_field_names
The output field name includes the table name. This can also be set using the QUALIFIED keyword. This is the default.
The output field name will not include the table name. This can also be set using the UNQUALIFIED keyword.
# Name: addjoin.py
# Purpose: Join a table to a featureclass and have the output unqualified
# Import system modules
# Set environment settings
arcpy.env.workspace = "C:/data"
arcpy.env.qualifiedFieldNames = False
# Set local variables
inFeatures = "Habitat_Analysis.gdb/vegtype"
layerName = "veg_layer"
joinTable = "vegtable.dbf"
joinField = "HOLLAND95"
expression = "vegtable.HABITAT = 1"
outFeature = "Habitat_Analysis.gdb/vegjoin"
# Create a feature layer from the vegtype featureclass
# Join the feature layer to a table
arcpy.AddJoin_management(layerName, joinField, joinTable, joinField)
# Copy the layer to a new permanent feature class
# Output fields are unqualified, so the field name will
# not contain the origin table