Select to view content in your preferred language

How to handle a joined field?

433
3
11-22-2010 06:02 PM
GeorgeAzzari
New Contributor
Hi everybody,

I apologize if my question sounds stupid to many of you, but I am really a beginner with both Python and ArcGIS. 

Following the suggestion given by Donovan Cameron in this thread, I JOINED my polygon attribute table with an another one (i.e. Sum_Output.dbf). So now I have some fields in my polygon attribute table that are the result of this JOIN operation. One example is the OID field.

Now, here comes the Python question/problem, it seems that I can't  access none of those joined fields (e.g. OID) with cursors, because those fields don't actually belong to my polygon attribute table.  Is there a way to "copy"  the joined fields as they appear to my actual polygon attribute table?

Thank you in advance for your help!
Tags (2)
0 Kudos
3 Replies
DonovanCameron
Occasional Contributor II
Once the join is performed in ArcMap, right click the joined layer and go down to Data -> Export

In arcmap, when a join is performed, it is only in-memory so-to-speak. The join will only exist inside the map document it was performed on.

Exporting using the step above will make the join permanent with the joined fields now part of the attribute table. Note that this does create a new feature class/shapefile (or duplicate depending on how your workflow is currently being defined) so perhaps the old layer could be considered residual and be safe for the trashbin?

In earlier versions of arc, I remember seeing that these temp fields were denoted with an Asterix * attached to the columns header. I think now, they are expressed more in a SQL/pythonic manner, example: layername.FieldName

That formatting of the attribute header will disappear when the join has become permanent.
0 Kudos
toddsams
New Contributor III
Can anyone describe how a "join" and "data -> Export" would be accomplished using python code?
0 Kudos
ChrisMathers
Regular Contributor II
arcpy.AddJoin() This requires you to make a feature layer of your base table. the joined table doesnt need to be a feature layer or table view

arcpy.CopyFeatures() This will copy your feature layer that you just joined to to a shp.
0 Kudos