I keep raising errors with my where_clause in the 9th line of this script. FID is an Object ID field and I want the cursor to select whatever row it is currently pointing at. I don't know how to do this with proper syntax - any ideas? I am running this on ArcGIS Desktop 10.3.
This is the error:
Runtime error Traceback (most recent call last): File "", line 27, in File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 7211, in SelectLayerByAttribute raise e ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute).
#Make a layer out of the the original FC
arcpy.MakeFeatureLayer_management(fc, 'Sales_lyr')
#Use an update cursor when there is a value you need to change in the attribute table
with arcpy.da.UpdateCursor('Sales_lyr', ["BOROUGH", "FID", "COUNT"]) as cursor:
#For every row in the cursor, do the following
for row in cursor:
#Select the current row in the UpdateCursor
arcpy.SelectLayerByAttribute_management('Sales_lyr', "NEW_SELECTION", "FID IN(" + str(row[1]) + ")")