I have a feature class that resides in an Enterprise geodatabase, I need to delete a row that has specific text in a specific field at a specific. Data is being submitted daily to this feature class via Survey123, a "dummy" point is created daily for other purposes. I would like to delete that "dummy" point daily at a specific time using ArcPy. I am novice with ArcPy.
import arcpy
myFC = ("target dataset")
commentfield = 'Comments'
sql = """{0} LIKE '%NameOfTextToSearchFor%'""".format(arcpy.AddFieldDelimiters(myFC,commentfield))
with arcpy.da.UpdateCursor(myFC, commentfield, sql) as cursor:
for row in cursor:
cursor.deleteRow(row)
I couldn't figure out how to indent the last two lines