edit = arcpy.da.Editor(env.workspace) edit.startEditing(True, True) edit.startOperation() #Use an update cursor to update the values. This cursor gets all the records in the SectionsToCache feature class where CACHE = 'Yes' with arcpy.da.UpdateCursor(inputFeatureClass, fieldName, whereClause) as cursor: # Update the field value to 'No' for row in cursor: print row[0] row[0]= "No" cursor.updateRow(row) edit.stopOperation() edit.stopEditing(True)
Solved! Go to Solution.
outTable = "SectionsToUpdate" arcpy.MakeFeatureLayer_management(inputFeatureClass, outTable, whereClause, workspace) with arcpy.da.Editor(workspace) as edit: arcpy.CalculateField_management(outTable, fieldName, "'No'", "PYTHON_9.3")
outTable = "SectionsToUpdate" arcpy.MakeFeatureLayer_management(inputFeatureClass, outTable, whereClause, workspace) with arcpy.da.Editor(workspace) as edit: arcpy.CalculateField_management(outTable, fieldName, "'No'", "PYTHON_9.3")