Field alias name missing in the exported feature classes

1690
8
11-15-2016 03:55 AM
Jose_FrancisK_J
New Contributor

I have a set of feature classes in file gdb. while exporting these to SDE via arcpy, the field names "SHAPE_Length" and "SHAPE_Area" got changed to"SHAPE.LEN" and "SHAPE.AREA" respectively.
There was alias name for both these fields in GDB which  got missed in the SDE.

I could right click on the feature class and from the properties window i can update the alias name of these fields. But the "Alter Field" tool in "Data Management Tools" fails to update the alias name for these fields.

I've a lot of feature classes and its not practical to manually update the fields.

Is there any way to preserve the field alias for these fields during the export? Or is there any other way to update the alias name programmatically.

I've used the CopyFeatures_management in arcpy to export the feature classes.

Thanks in advance.

0 Kudos
8 Replies
NeilAyres
MVP Alum

Is there any particular reason you need a specific alias for these required fields?

You could run through the tables again using the AlterField tool in the Data Management / Fields toolset.

0 Kudos
NeilAyres
MVP Alum

Ah, I see you have already tried that.

I suppose you have the correct permissions for your SDE?

0 Kudos
Jose_FrancisK_J
New Contributor

what additional permission is required for this ?

I'm able to modify other fields using the AlterField tool. Also, I'm able to manually update the alias name of these fields ("SHAPE.LEN" and "SHAPE.AREA" ) by right clicking on the feature class.

My ArcGIS Desktop Version is 10.3 and I'm connecting to Oracle using direct connection.

0 Kudos
NeilAyres
MVP Alum

Sorry, don't have access to an SDE here to test anything (and definately not on Oracle).

There are a few hits from here on Geonet and SE regarding renaming Alias names but am am not sure if they apply in your case.

0 Kudos
Jose_FrancisK_J
New Contributor

I'm not even able to alter the alias for a field in GDB feature class

Here is the sample code used to alter the alias name:

    fc = r"C:\Users\jose\Documents\ArcGIS\Default.gdb\World_Map"
    desc = arcpy.Describe(fc)
    arcpy.AlterField_management(fc, desc.AreaFieldName, new_field_alias="Shape Area")
    arcpy.AlterField_management(fc, desc.LengthFieldName, new_field_alias="Shape Length")

I'm getting the following error:

arcgisscripting.ExecuteError: ERROR 001625: Failed to alter field is nullable.
Failed to execute (AlterField).

0 Kudos
NeilAyres
MVP Alum

Jose,

Just tried this. And I get the same error (using v10.4.1).

Perhaps you just can't change the alias of a required field like the Shape_Length or Area.

0 Kudos
Jose_FrancisK_J
New Contributor

Even the script and the AlterField tool are throwing exceptions, I could see that the SDE feature classes got updated with the new alias provided. So I'm planning to ignore these errors and continue with the script.

Thanks for the support.

0 Kudos
NeilAyres
MVP Alum

Good luck....

0 Kudos