<?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: Update table attributes from another table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677353#M52433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried your code and i get ERROR 000358: Invalid expression.&lt;/P&gt;&lt;P&gt;How would you get it to update table 1 with the missing names?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2017 15:22:16 GMT</pubDate>
    <dc:creator>CCWeedcontrol</dc:creator>
    <dc:date>2017-07-19T15:22:16Z</dc:date>
    <item>
      <title>Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677349#M52429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table(Table1) that i need to update on a regular basis by&lt;SPAN&gt; comparing/matching the records in the&amp;nbsp; (Table1) to the table (Table2) based on field "Street" of Table1 and "FullStName" of table two. If theirs NOT a match it then updates the table1 based on the NOT matched from the table and I also need it to add &lt;SPAN&gt;"FullStName" have have&amp;nbsp;"RES", "Reserved", "proposed" in the "status" field of table2. I need to add the missing names of tabel2 to table 1. Hopefully it make sense.&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i have but i am not sure i am doing it right...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy
from arcpy import env

arcpy.env.workspace = r"C:\Temp\Default.gdb\RoadNames"
Rtable = "table1"&amp;nbsp; 
table1 = "table2"&amp;nbsp; 
&amp;nbsp; 
fcIncident = []&amp;nbsp; 
tableIncident = []&amp;nbsp; 
&amp;nbsp; 
with arcpy.da.SearchCursor(Rtable, ["Street"]) as cursor:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcIncident.append(row[0])&amp;nbsp; 
&amp;nbsp; 
del row, cursor&amp;nbsp; 
&amp;nbsp; 
with arcpy.da.SearchCursor(table1, ["FULLSTNAME", "STATUS"]) as cursor:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[1] in ("RES", "Reserved", "proposed"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not row[0] in fcIncident:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tableIncident.append(row[0])&amp;nbsp; 
&amp;nbsp; 
del row, cursor&amp;nbsp; 
&amp;nbsp; 
arcpy.MakeTableView_management(table1, "tblView")&amp;nbsp; 
&amp;nbsp; 
for ID in tableIncident:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("tblView", "ADD_TO_SELECTION", "FULLSTNAME = " + str(ID)) 


&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677349#M52429</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-12T04:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677350#M52430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;more to the question... did it do anything? errors?&amp;nbsp;&lt;/P&gt;&lt;P&gt;My first thought would be to join table B to table A, run your query where they are not equal, then use a field calculate (Calculate Field) to update the table A values with them from table B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 22:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677350#M52430</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-07-18T22:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677351#M52431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: &amp;nbsp;Now that I think about this more.. the below code will&amp;nbsp;only select the in-memory layer by the streets that are not in table2. &amp;nbsp;If you need to add the missing names to table two, like actually add the rows in the table, you'll need to use an&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/insertcursor-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/data-access/insertcursor-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;InsertCursor—Data Access module | ArcGIS Desktop&lt;/A&gt;. &amp;nbsp;Is this what you're trying to do?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'...path to database'&lt;/SPAN&gt;

table1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'table1'&lt;/SPAN&gt;
table2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'table2'&lt;/SPAN&gt;

table1List &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Street'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table1List&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor

ids &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
included &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"RES"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Reserved"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"proposed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'FULLSTREET'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; included&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; table1List&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ids&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeTableView_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"table1view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

qry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{} IN ('{}')"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FULLSTREET"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"', '"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;x &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; x &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; ids&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"table1view"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;qry&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:33:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677351#M52431</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2021-12-12T04:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677352#M52432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get ERROR 000358: Invalid expression.&lt;/P&gt;&lt;P&gt;How do you query where they are not equal to a joined tables?&lt;/P&gt;&lt;P&gt;How do you update the table with only the missing names?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:19:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677352#M52432</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2017-07-19T15:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677353#M52433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried your code and i get ERROR 000358: Invalid expression.&lt;/P&gt;&lt;P&gt;How would you get it to update table 1 with the missing names?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:22:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677353#M52433</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2017-07-19T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677354#M52434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly do you mean by "update table 1 with the missing names"? &amp;nbsp;Do you mean insert the rows into the table? &amp;nbsp;Or update the old street names with the new ones from table 2?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 20:49:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677354#M52434</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-07-19T20:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677355#M52435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Insert the missing names(rows) from table 2 to table 1. Table 1 is the main table that needs to be updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 21:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677355#M52435</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2017-07-19T21:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677356#M52436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, set your arcpy.env.workspace to a database, not a feature class. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the code below, and edit line 3 &amp;amp; 15. &amp;nbsp;If table1 has different field names than table2, simply create a new list variable, 'table2fields', and specify the required fields. &amp;nbsp;Then, replace 'fields' with 'table2fields' on line 28. &amp;nbsp;Please read more about&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/insertcursor-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/data-access/insertcursor-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;InsertCursor&lt;/A&gt;&amp;nbsp;and how it functions. &amp;nbsp;The items in the 'ids' list must be indexed to the field lists in order for the values to be written to the proper fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'...path to database...'&lt;/SPAN&gt;

table1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'table1'&lt;/SPAN&gt;
table2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'table2'&lt;/SPAN&gt;

table1List &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Street'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table1List&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor

&lt;SPAN class="comment token"&gt;#list of fields whose will need to be imported into table2&lt;/SPAN&gt;
fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'FULLSTREET'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Input_Other'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Necessary_Fields'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Here'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#list of values from table1 to inject into table2&lt;/SPAN&gt;
ids &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
included &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"RES"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Reserved"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"proposed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; included&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; table1List&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ids&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor

&lt;SPAN class="comment token"&gt;#create insert cursor variable&lt;/SPAN&gt;
insertCursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#loop through items in ids list and insert into table&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; ids&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insertCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insert&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:33:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677356#M52436</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2021-12-12T04:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677357#M52437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my apologies for not being clear and really appreciate you helping me with this. The code you posted looks to inject&amp;nbsp;"RES","Reserved","proposed" fields into table 2, which is not what am after. i am needing to copy road names from table 2 field ( "FULLSTNAME") to table 1 field ( "Street") but only if they don't already&amp;nbsp; exist in table 1. we can disregard the "RES","Reserved","proposed" i think its making it confusing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 15:03:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677357#M52437</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2017-07-20T15:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677358#M52438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, then remove line 19. &amp;nbsp;Remove line 22. &amp;nbsp;Dedent ( CTRL + [ ) lines 23 and 24.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 15:54:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677358#M52438</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-07-20T15:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677359#M52439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shouldn't the insertCursor be on Table1 since that is the table i am needing to update?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error.&lt;/P&gt;&lt;P&gt;insertCursor.insert(i)&lt;BR /&gt;AttributeError: 'da.InsertCursor' object has no attribute 'insert'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;table1List = []
with arcpy.da.SearchCursor(table1, ['Street']) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table1List.append(row[0])
del cursor

#list of fields whose will need to be imported into table2
fields = ['FULLSTNAME']

#list of values from table1 to inject into table2
ids = []

with arcpy.da.SearchCursor(table2, ['FULLSTNAME']) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[0] not in table1List:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ids.append(row[0:])
del cursor

#create insert cursor variable
insertCursor = arcpy.da.InsertCursor(table2,fields)

#loop through items in ids list and insert into table
for i in ids:
&amp;nbsp;&amp;nbsp;&amp;nbsp; insertCursor.insert(i)
del insertCursor
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677359#M52439</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-12T04:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677360#M52440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you're correct. &amp;nbsp;Change 'table1' to 'table2' in line 19. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oops... regarding the error: change 'insertCursor.insert(i)' in line 23 to 'insertCursor.insertRow(i)'.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 18:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677360#M52440</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-07-20T18:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update table attributes from another table</title>
      <link>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677361#M52441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean change 'table2' to 'table1' in line 20?&lt;/P&gt;&lt;P&gt;I have inserted the "Row" in insertCursor.insertRow(i)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 18:51:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-table-attributes-from-another-table/m-p/677361#M52441</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2017-07-20T18:51:04Z</dc:date>
    </item>
  </channel>
</rss>

