How to delete all rows where a where clause is met with arcpy.da.UpdateCursor

المشرف العام

Administrator
طاقم الإدارة
I would like to use a where clause that finds a certain columns, and if empty then delete the row.

My SQL where clause is; SELECT UID2 FROM MY311CONTAINERS_2 WHERE SR_SN_2 ' ' AND SR_COLOR_2 ' ' AND SR_SIZE_2 ' ' AND SR_LOCATION2 ' '

Here is my code:

import arcpyaContainerFC2 = 'fc'fields = ("SR_SN_2", "SR_LOCATION_2", "Dist02", "SR_Color_2", "SR_Size_2")whereClause = fields + " ' ' "updCurs = arcpy.UpdateCursor(aContainerFC2, whereClause)for row in updCurs: if not row.getValue(field): updCurs.deleteRow(row)Error:

TypeError: can only concatenate tuple (not "str") to tuple

أكثر...
 
أعلى