Thanks for your reply Richard-
I was posting quickly, hoping it was a very simple answer. the old script did exactly as you say- looping through using cursors. the dictionary approach is much quicker! I just need to figure out how to write the outputs to the same change table. one other question I have: can you compare dictionaries against each other? in my instance below, I am comparing one dictionary to a search cursor result (table A dict to FC B cursor), and then doing it again (FC B dict to Table A Cursor)- I am new to this whole thing and not that clear on the logic I need to make it all work...
here is the code I am working with:
Thanks for your help!
Table_A = r'\\StagingTesting.gdb\Table'
FC_B = r'\\StagingTesting.gdb\Table_GIS_Features'
Table_C = r'\\BackupTesting.gdb\changesTable'
Tolerance = 0.05
arcpy.DeleteRows_management(Table_C)
Table_A_Cursor = arcpy.da.SearchCursor (Table_A,['field A','field B','field C','field D','field E'],)
FC_B_Cursor = arcpy.da.SearchCursor (FC_B,['field A','field B','field C','field D','field_B_Text'],)
rows = arcpy.InsertCursor(Table_C, ['field D', 'field C', 'field B','field A', 'field E', 'field F'])
table_a_data = {r[0]:r[1:] for r in arcpy.da.SearchCursor (Table_A,['field A','field B','field C','field D','field E'],)}
FC_B_data = {r[0]:r[1:] for r in arcpy.da.SearchCursor (FC_B,['field A','field B','field C','field D'],)}
for row in Table_A_Cursor:
table_a_data[row[0]] = row[1]
for row in FC_B_Cursor:
if abs(row [1]-table_a_data[row[0]])>Tolerance:
insert = rows.newRow()
insert.setValue("field D", row[3])
insert.setValue("field C", row[2])
insert.setValue("'field B'", row[4])
insert.setValue("field F", 'NEW ACREAGE:Update Acres')
rows.insertRow(insert)
del row
for row2 in FC_B_Cursor:
FC_B_data[row2[0]] = row2[1]
for row2 in Table_A_Cursor:
if not row2[0] in FC_B_data:
insert = rows2.newRow()
insert.setValue("field D", row2[3])
insert.setValue("field C", row2[2])
insert.setValue("'field B'", row2[1])
insert.setValue("field E", row2[4])
insert.setValue("field F", 'NOT IN GIS:DELETE FROM Table_A?')
rows.insertRow(insert)
del row2
del rows