1

According to the help file, the ALTER FIELD command is available at any license level.

ArcGIS for Desktop Basic: Yes

Why am I getting a license error when trying to rename a field alias on a sample file geodatabase featureclass?

> arcpy.Describe(u"e:/test.gdb/testFC").fields[2].name
> u'oldfieldname'
> arcpy.AlterField_management(u"e:/test.gdb/testFC", "oldfieldname", "newfieldname" ,"newaliasname")
> ExecuteError: Failed to execute. Parameters are not valid.
> ERROR 000824: The tool is not licensed.

This is a brand new, standard, empty featureclass which I just created for the purposes of this test.

asked Jun 25, 2015 at 0:33
8
  • 1
    'TEXT' is not a valid field name? What is your feature class type? Perhaps you'll have better results not using a SQL reserved keyword like "TEXT_Val" see gis.stackexchange.com/questions/123736/…. According to resources.arcgis.com/en/help/main/10.2/index.html#//… the parameters go feature class, existing field, new name, new alias.. there's nothing there about the type. Commented Jun 25, 2015 at 0:51
  • Michael is right. Simply change "TEXT" to "newfieldname". Commented Jun 25, 2015 at 0:57
  • You referred to the Add FieldManagement doc Commented Jun 25, 2015 at 0:58
  • @MichaelMiles-Stimson I removed that to avoid confusion - it still fails with the same error message if I give a new field name. In fact I only want to change the alias but that's a separate question.... Commented Jun 25, 2015 at 0:59
  • 1
    @StephenLead Alter fields is relatively new (10.2.2 I think) - what version are you using? Whichever it is would not explain the error message but might help shine some light. Commented Jun 25, 2015 at 1:04

1 Answer 1

2

I have no idea why you would receive that error but to move forward I would try running the test code below (with values from your own feature class) from IDLE (or your own IDE).

It worked for me using ArcGIS 10.3.1 for Desktop.

import arcpy
oldFieldName = arcpy.Describe("C:/temp/test.gdb/testFC").fields[4].name
oldFieldAlias = arcpy.Describe("C:/temp/test.gdb/testFC").fields[4].aliasName
print oldFieldName
print oldFieldAlias
arcpy.AlterField_management("C:/temp/test.gdb/testFC", oldFieldName, "NewField" ,"NewAlias")
newFieldName = arcpy.Describe("C:/temp/test.gdb/testFC").fields[4].name
newFieldAlias = arcpy.Describe("C:/temp/test.gdb/testFC").fields[4].aliasName
print newFieldName
print newFieldAlias

Output was:

>>> ================================ RESTART ================================
>>> 
OldField
OldAlias
NewField
NewAlias
answered Jun 25, 2015 at 3:19
1
  • Yep, that's pretty much was I was doing (unsuccessfully) in the original test. Looks like it's a problem with my installation, and/or a bug at 10.2. Thanks for verifying. Commented Jun 25, 2015 at 3:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.