I'm stuck on results that arcpy.SearchCursor is outputting. I'm accessing a table on a database connection. When I run this, it crashes with an error: argument of type 'Row' is not iterable
I ended up changing the code below, to simply print the row, and it comes back with:
<geoprocessing row object object at 0x048F8440>
Any idea what I'm doing wrong or what I'm missing?
import arcpy import csv MyData = arcpy.SearchCursor("c:/users/Rando/AppData/Roaming/ESRI/Desktop10.7/ArcCatalog/DB.sde/RandoTable") Phrase = "Some Words" for row in MyData: if Phrase in row: TheAnswer = row.getValue("TheHeader")
arcpy.SearchCursorfor new code. Instead usearcpy.da.SearchCursor, which returns a list of lists, and could potentially honor theinoperator. (You'd still be better off using thewhere_clauseparameter to implement theif.)