rows = arcpy.UpdateCursor("Assets") for row in rows: if row.Processed == "N" and row.Asset_ID == "Asset_Unprocessed.Asset_ID": row.Processed = "Y" rows.updateRow(row) del row del rowsSolved! Go to Solution.
import arcpy
from arcpy import env
import datetime
import os
env.workspace = "c:\Users\matt\Desktop\Projects\Assets\Assets.mdb"
#Make a TableView of Non-Spatial Asset records that need to be processed
arcpy.MakeQueryTable_management (["Assets"], "Asset_Line", "ADD_VIRTUAL_KEY_FIELD", "",[["Asset_ID"], ["Ditch_ID"], ["Begin_Station"], ["End_Station"]], "[Assets.Processed] <> 'Y'")
#Add queried data to Assets_Unprocessed table-to be used by ArcObjects utility to create spatial features
arcpy.Append_management ("Asset_Line", "Assets_Unprocessed")
#Copy attribute data to spatial Asset features
#Call ArcObjects utility to snap 'out of ditch' linear features to spatial Asset features
#Call ArcObjects utility to snap related assets to spatial Asset features
au = "Assets_Unprocessed"
lstIds = []
fld = "Asset_ID"
auRows = arcpy.SearchCursor(au)
for row in auRows:
lstIds.append(row.Asset_ID)
del row, auRows
table2 = "Assets"
for ID in lstIds:
rows = arcpy.UpdateCursor(table2)
for row in rows:
if row.Asset_ID == ID:
row.Processed = 'Y'
rows.updateRow(row)