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\\CCENTGIS_SCLFinal_PRSCL_test.sde\\prscl_test.SCLADMIN.GMSCL" 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!.strip", "PYTHON_9.3", "")
with arcpy.da.Editor(workspace) as edit: arcpy.CalculateField_management( layer_name, 'Usage', '"PUBLIC"', 'PYTHON')
import arcpy workspace = "Database Connections\\CCENTGIS_SCLFinal_PRSCL_test.sde\\prscl_test.SCLADMIN.GMSCL" 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!.strip", "PYTHON_9.3", "")