AnsweredAssumed Answered

how to check if cursor object is empty?

Question asked by turnerkyle on Feb 2, 2012
Latest reply on Aug 26, 2016 by blake.terhune
It seems an easy task, but I can't figure out how to check if the searchcursor object is empty.
I know that it is empty because the query fails....i.e. arcpy.searchcursor(FC, query).
However, even if it (arcpy.searchcursor..) fails, it still returns a geoprocessing cursor object...

rows = gp.SearchCursor(crosswalk_dbf,query)

print rows ---> returns
<geoprocessing cursor object object at 0x029C7CC0>


I can't check if it's empty, because, well, it's not.
And for reasons I obviously don't understand.......

rows = gp.SearchCursor(crosswalk_dbf,query)
for row in rows:
  if not row.isNull(fieldname)

------------

is always 'true'.

Please help.

I'm using Arc10 SP3, win 7 64bit.

Many thanks.

Outcomes