<?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 How to use Search/Update Cursor to update values of one feature class to another? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-search-update-cursor-to-update-values/m-p/514977#M40412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Taken from gis.stackexchange.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a process which requires me to update the data of an application every week. The application's data is in an .SDE database while the updated data is in a file geodatabase. The updated data could contain new features or have features removed. The dataset has a relationship class which is why I do not want to delete the feature class. How should this example be adjusted to completely overwrite or update all rows from my FGDB to my .SDE database?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fields = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"HOUSENO; DIR; STREET; DPAFEEDER; LSDATE; REMARKS; ACCOUNT_NO, SYMBOLROTATION"
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;
&lt;/SPAN&gt;fgdbRows = arcpy.SearchCursor(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'Q:\GWP_LifeSupport.gdb\LifeSupport'&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'''DPAFEEDER IS NOT NULL'''&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;""&lt;/SPAN&gt;, fields, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;""&lt;/SPAN&gt;)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;aRow &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;fgdbRows:
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(aRow.HOUSENO, aRow.DIR, aRow.STREET, aRow.UNIT, aRow.DPAFEEDER, aRow.LSDATE, aRow.REMARKS, aRow.ACCOUNT_NO, aRow.SYMBOLROTATION)

sdeLs = arcpy.UpdateCursor(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'Database Connections\gisDev01.sde\SDEDEV.SDE.LifeSupport'&lt;/SPAN&gt;)


&lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;sdeLs:
&amp;nbsp; sdeLs.updateRow(aRow)
&lt;CODE&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:30:20 GMT</pubDate>
    <dc:creator>GeoffreyWest</dc:creator>
    <dc:date>2021-12-11T22:30:20Z</dc:date>
    <item>
      <title>How to use Search/Update Cursor to update values of one feature class to another?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-search-update-cursor-to-update-values/m-p/514977#M40412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Taken from gis.stackexchange.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a process which requires me to update the data of an application every week. The application's data is in an .SDE database while the updated data is in a file geodatabase. The updated data could contain new features or have features removed. The dataset has a relationship class which is why I do not want to delete the feature class. How should this example be adjusted to completely overwrite or update all rows from my FGDB to my .SDE database?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fields = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"HOUSENO; DIR; STREET; DPAFEEDER; LSDATE; REMARKS; ACCOUNT_NO, SYMBOLROTATION"
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;
&lt;/SPAN&gt;fgdbRows = arcpy.SearchCursor(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'Q:\GWP_LifeSupport.gdb\LifeSupport'&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'''DPAFEEDER IS NOT NULL'''&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;""&lt;/SPAN&gt;, fields, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;""&lt;/SPAN&gt;)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;aRow &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;fgdbRows:
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(aRow.HOUSENO, aRow.DIR, aRow.STREET, aRow.UNIT, aRow.DPAFEEDER, aRow.LSDATE, aRow.REMARKS, aRow.ACCOUNT_NO, aRow.SYMBOLROTATION)

sdeLs = arcpy.UpdateCursor(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;r'Database Connections\gisDev01.sde\SDEDEV.SDE.LifeSupport'&lt;/SPAN&gt;)


&lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;sdeLs:
&amp;nbsp; sdeLs.updateRow(aRow)
&lt;CODE&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:30:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-search-update-cursor-to-update-values/m-p/514977#M40412</guid>
      <dc:creator>GeoffreyWest</dc:creator>
      <dc:date>2021-12-11T22:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Search/Update Cursor to update values of one feature class to another?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-search-update-cursor-to-update-values/m-p/514978#M40413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given that your primary/authoritative data is in an enterprise geodatabase, you might be better off using geodatabase replication (See &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/understanding-distributed-data.htm"&gt;Understanding distributed data&lt;/A&gt;).&amp;nbsp; Unless I misunderstand your situation, this is one of the use cases geodatabase replication was designed around.&amp;nbsp; Esri has already done the hard work, why not leverage it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 00:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-search-update-cursor-to-update-values/m-p/514978#M40413</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-08-11T00:37:13Z</dc:date>
    </item>
  </channel>
</rss>

