I created a view in a (SQL Server) geodatabase, registered it with the geodatabase, and am now trying to set field aliases, but AlterField fails on line 7 with the message ERROR 000499: table is not editable
The relevant code looks like this:
if arcpy.Exists(VIEW_NAME):
arcpy.management.Delete(VIEW_NAME)
arcpy.management.CreateDatabaseView(settings.DATABASE, VIEW_NAME, sql)
arcpy.management.RegisterWithGeodatabase(VIEW_NAME, "OBJECTID", "SHAPE", "POLYLINE", arcpy.SpatialReference(28992))
arcpy.AlterAliasName(VIEW_NAME, "Readable name")
arcpy.management.AlterField(VIEW_NAME, "id", "id", "Nr.")
If I comment out line 1‒6, and re-run the script, it works without problems, so it looks as if the script creates a lock that prevents itself from continuing.
I am using ArcGIS Pro 3.5