I'm assuming this is pretty straightforward, and I am missing something fairly simple.
I am attempting to bring in a column of data values, 'FieldA', from a table, 'Table_1', to populate an empty field, 'FieldA', in a new, empty table, 'Table_2'. These 'FieldA' values will be used as a key in 'Table 2' for subsequent field calculations. Is there a direct way to do this?
I have been attempting to use a search cursor and update cursor combination to write the field values to the new table, though I am not sure how to successfully employ the cursors to update the single field without an existing key between the two tables (where I would use a dictionary).
Here is my unsuccessful, botched code:
search_feats <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>Table_1<SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">"FieldA"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
i <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>UpdateCursor<SPAN class="punctuation token">(</SPAN>Table_2<SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">"FieldA"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> upd_cur<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> upd_row <SPAN class="keyword token">in</SPAN> upd_cur<SPAN class="punctuation token">:</SPAN>
i<SPAN class="operator token">=</SPAN>i<SPAN class="operator token">+</SPAN><SPAN class="number token">1</SPAN>
upd_row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> search_feats <SPAN class="punctuation token">(</SPAN>i<SPAN class="punctuation token">)</SPAN>
upd_cur<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>upd_row<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> upd_cur
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
What may be a better way to approach this?