<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;Join Data&amp;quot; in Python Script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356219#M28008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For joining tables you need to have unqualified field names to stop the changing of the field names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.QualifiedFieldNames = "UNQUALIFIED"&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Generally when I join I use the below code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.JoinField_management(table1, field1, table2, field2)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This makes the join permanent, if you just want temporary joins then use the AddJoin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*Edit: When you join tables with unqualified names, any duplicate names will have "_1" added to the end to make them unique. This usually comes up in the fields the join is based on, which usually have the same name. At least in my environment. Also, using field mappings may solve your problems as they give specific field names as the output, but I find them more trouble than the time they save.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*Edit2: Oh sorry, see &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000008000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000008000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax is &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.env.qualifiedFieldNames = qualified_field_names&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;unless you have &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;from arcpy import env&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 May 2011 13:52:33 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2011-05-03T13:52:33Z</dc:date>
    <item>
      <title>&amp;quot;Join Data&amp;quot; in Python Script</title>
      <link>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356217#M28006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to use the "Join Data" function that is available when you right-click a feature class in the Table of Contents. But I need to call it from Python. Does anyone know how to access this function from Python? I am trying to join fields from a DBF to the attribute table of a shapefile. I want to use "Join Data" because it's quick and it doesn't change the field names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can't Use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-"Add Join" because it changes all of the field names to append the name of the file it came from. (Ex.: "landuse.FieldA", "landuse.FieldB", "lookup_tab.FieldC", and "lookup_tab.FieldD".) The "Join Data" tool doesn't change the field names. I would have to find an automated way to change the field names back, stripping the file names off of the fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-"Join Field" because it takes *hours* to join the table (instead of just seconds with "Join Data" or "Add Join").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to access the "Join Data" function in Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've gotten several suggestions saying that I should just use "Add Join" and then change all of my field names, and several others saying that I should just manually right-click to use "Join Data", then run the script for the rest of the processing I need to do. I would rather use the best tool for the job.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-T.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 17:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356217#M28006</guid>
      <dc:creator>TiernanErickson</dc:creator>
      <dc:date>2011-05-02T17:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: "Join Data" in Python Script</title>
      <link>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356218#M28007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Interesting because when I use the join option by right clicking on the layer and selecting the join option from the context menu it put the filename.fieldname on the headers in the attribute file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 19:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356218#M28007</guid>
      <dc:creator>TerrySilveus</dc:creator>
      <dc:date>2011-05-02T19:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: "Join Data" in Python Script</title>
      <link>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356219#M28008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For joining tables you need to have unqualified field names to stop the changing of the field names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.QualifiedFieldNames = "UNQUALIFIED"&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Generally when I join I use the below code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.JoinField_management(table1, field1, table2, field2)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This makes the join permanent, if you just want temporary joins then use the AddJoin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*Edit: When you join tables with unqualified names, any duplicate names will have "_1" added to the end to make them unique. This usually comes up in the fields the join is based on, which usually have the same name. At least in my environment. Also, using field mappings may solve your problems as they give specific field names as the output, but I find them more trouble than the time they save.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*Edit2: Oh sorry, see &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000008000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000008000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax is &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.env.qualifiedFieldNames = qualified_field_names&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;unless you have &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;from arcpy import env&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 May 2011 13:52:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/amp-quot-join-data-amp-quot-in-python-script/m-p/356219#M28008</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-05-03T13:52:33Z</dc:date>
    </item>
  </channel>
</rss>

