You don't need to call reset(), you should be able to just do for row in arcpy.da.SearchCursor(layer,("SHAPE@","OID@"),sWhereClause,None,False,sql_clause):
and avoid all that extra code.
I tried this one
>>> dsc = arcpy.Describe("Demo.DBO.U1H000Ruimte")
>>> OIDFieldName = dsc.OIDFieldName
>>> delimitedFieldName = arcpy.AddFieldDelimiters("Demo.DBO.U1H000Ruimte", OIDFieldName)
>>> print delimitedFieldName
"OBJECTID"
>>> sWhereClause = delimitedFieldName + " < 100"
>>> print sWhereClause
"OBJECTID" < 100
>>> sql_clause = (None,'ORDER BY OBJECTID DESC')
>>> print sql_clause
(None, 'ORDER BY OBJECTID DESC')
>>> for row in arcpy.da.SearchCursor("Demo.DBO.U1H000Ruimte",("SHAPE@","OID@"),sWhereClause,None,False,sql_clause):
... print row[1]
...
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: expected callable function - logger(obj)
Then tried:sql_clause = (None,'ORDER BY "OBJECTID" DESC')
But I keep getting the same results.Everything is ok if I omit the sql_clause part, so I must doing something wrong with that part. Any ideas?Update: Then tried this one, swapping the explode_to_points and sql_clause parameters
>>> for row in arcpy.da.SearchCursor("Demo.DBO.U1H000Ruimte",("SHAPE@","OID@"),sWhereClause,None,(None,'order by objectid desc'),None):
... print row[1]
This will print the objectids but not in descending order. What I don't understand is that the tuple is accepted for the explode_to_points parameter (that is supposed to take values of True and False only)