I am trying to select all the features/attributes of a feature class but I am unable accomplish this, can someone help me out.
I have tried the following but i get arcgisscripting.ExecuteError: ERROR 000358: Invalid expression
Failed to execute (SelectLayerByAttribute)." on line 6. If this is not the best/easiest way please share what would be.
arcpy.MakeFeatureLayer_management(fc, 'FcLyr')
#oids = [row[0] for row in arcpy.da.SearchCursor('FcLyr', "OID@")]
with arcpy.da.SearchCursor('FcLyr', ["OID@"]) as selected_fc:
for row in selected_fc:
print (row)
arcpy.SelectLayerByAttribute_management('FcLyr', "NEW_SELECTION", row[0]) #"OBJECTID = {}".format(row[0])
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>