If cursor not updating rollback is required
21-Sep-2020 20:17
import arcpy, time updated_rid_dict = updated_rows = 0 # Grab UIDs and geometries of updated regions with Search Cursor(good_geometry_shape, field_names=['Region ID', '[email protected]']) as cursor: for row in cursor: updated_rid_dict[row[0 = row[1] print " updated regions found".format(len(updated_rid_dict)) # returns 594 # Open an edit session and attempt to find all the regions in updated_rid_dict edit = When you start the recording, you have a checkbox "not possible, but anyway it makes no sense to transport them: the recordings have no vocation to remain in the system, and are usually converted into programs or function modules, which are cross-client.
||import arcpy, time updated_rid_dict = updated_rows = 0 # Grab UIDs and geometries of updated regions with
Search Cursor(good_geometry_shape, field_names=['Region ID', '[email protected]']) as cursor: for row in cursor: updated_rid_dict[row[0]] = row[1] print " updated regions found".format(len(updated_rid_dict)) # returns 594 # Open an edit session and attempt to find all the regions in updated_rid_dict edit =
]]I change it back to "Update Cursor" and arcpy can only find some of the regions. Does Update Cursor have some sort of limitations I'm not aware of? # Open an edit session and attempt to find all the regions in updated_rid_dict edit =
The problem is not all of the polygons are getting updated, even though the exact same UIDS exist in both feature classes.
Some of them update just fine, but just under half do not.
Editor([path to my data]) edit.start Editing(False, False) edit.start Operation() with
Update Cursor(bad_geometry_shape, field_names=['Region ID', '[email protected]']) as cursor: for row in cursor: # See if the feature is in the updated_rid_dict if row[0] in updated_rid_dict: updated_rows = 1 del updated_rid_dict[row[0 Operation() Editing(True) print " rows updated.".format(updated_rows) # Returns only 313 The code above doesn't even attempt to do an update.
If BDC_SUBSCR refer to a non-existing subscreen, it is ignored.
||Update Cursor(bad_geometry_shape, field_names=['Region ID', '[email protected]']) as cursor: for row in cursor: # See if the feature is in the updated_rid_dict if row[0] in updated_rid_dict: updated_rows = 1 del updated_rid_dict[row[0]] Operation() Editing(True) print " rows updated.".format(updated_rows) # Returns only 313 The code above doesn't even attempt to do an update.If BDC_SUBSCR refer to a non-existing subscreen, it is ignored.
]]