Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

update an attribute if record found in a query

$
0
0
I am trying to update an attribute in one table, if that record is found in a MakeQuery table (I made a table view of all records not yet processed, and once processed, I want to turn the 'Processed' flag to 'Y').

Code:

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 rows

I am trying to update in the Assets table the 'Processed' flag to 'Y', IF the Assets key is found in the 'Assets_Unprocessed' table. This does not throw an error, it just does not find and update my test data properly. The issue is the comparison to the Assets_Unprocessed table (the rest of the code works), and I've tried several different ways to type that table (full path, brackets, etc.) and can't seem to get that part to work.

Viewing all articles
Browse latest Browse all 2485

Trending Articles