How to compare two fields from two different feature classes in arcpy

807
2
06-23-2019 09:47 AM
SuryaNarayana
New Contributor

Hi Users,

I have two feature classes, i.e FC1 with fields [C_PIN, IsSelected], and FC2 with field [PIN].  Now I want to update the field values of [IsSelected] for the rows in which [C_PIN] and [PIN] are same.

Please share any sample code for my requirement.

Thank you in advance. 

Tags (2)
0 Kudos
2 Replies
JoeBorgione
MVP Emeritus

I've been using this approach lately; it works really well:  /blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-diction... 

In these two threads I show examples:

RuntimeError: ERROR 999998: Unexpected Error in Set null function 

https://community.esri.com/thread/235543-arcpy-update-cursor-ifelse 

You don't specify what you are going to update; is it all fields where CPIN= PIN? or just a field or two? And what values ar going into that field or feilds?  If FC 2 has the field values you are looking for, this technique is the bomb....

That should just about do it....
SuryaNarayana
New Contributor

Thank you very much Joe, the articles helped me to complete my task.

0 Kudos