fc = "Database Connections\\CCENTGIS_SCLFinal_PRSCL_test.sde\\prscl_test.SCLADMIN.GMSCL\\prscl_test.SCLADMIN.sclarc" workspace = "Database Connections\\CCENTGIS_SCLFinal_PRSCL_test.sde" arcpy.MakeFeatureLayer_management(fc, "sclarc_layer") edit = arcpy.da.Editor(workspace) edit.startEditing() edit.startOperation() with arcpy.da.Editor(workspace) as edit: arcpy.CalculateField_management("sclarc_layer", "STRNAME", "!strname!.strip", "PYTHON_9.3", "") edit.stopOperation() edit.stopEditing(True)
Solved! Go to Solution.
import arcpy
workspace = "Database Connections\\PRSCL_TEST_SCLAdmin.sde"
fc = "prscl_test.SCLADMIN.sclarc"
arcpy.env.workspace = workspace
arcpy.MakeFeatureLayer_management(fc, "sclarc_layer")
with arcpy.da.Editor(workspace) as edit:
arcpy.CalculateField_management("sclarc_layer", "STRNAME", "!strname!.upper()", "PYTHON_9.3", "")import arcpy workspace = "Database Connections\\PRSCL_TEST_SCLAdmin.sde" fc = "prscl_test.SCLADMIN.sclarc" arcpy.env.workspace = workspace arcpy.MakeFeatureLayer_management(fc, "sclarc_layer") edit = arcpy.da.Editor(workspace) edit.startEditing(False, True) edit.startOperation() with arcpy.da.Editor(workspace) as fieldEdit: arcpy.CalculateField_management(fcLayer, "STRNAME", "!strname!.upper()", "PYTHON_9.3", "") edit.stopOperation() edit.stopEditing(True)