I need load OBJECTID from remote DB but I'm still getting error:
RuntimeError: Underlying DBMS error [ORA-00923: FROM keyword not found where expected] [SDEDO.E_EL_TU][STATE_ID = 22362]
I don't know why. After all, sql statement compiles SearchCursor do why I'm getting this error?
My code looks this:
import arcpy
obj_id = 0
table = "C:\\Temp\\My_connection.sde\\SDEDO.E_EL_TU"
with arcpy.da.SearchCursor(in_table=table, field_names=["OBJECTID"], sql_clause=("TOP 1", "ORDER BY OBJECTID DESC")) as cursor:
for row in cursor:
obj_id = row[0]
break
I was googling for a long time but nowhere is topic with this error and SearchCursor.