<?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: Edit Versioned Feature Class in python in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255601#M1615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;Thanks for responding.&amp;nbsp; I ended up using the append tool instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is that another department posts an excel file online and we want to update a feature class with the new data.&amp;nbsp; We want to completely replace the existing records with the new data.&amp;nbsp; So I am using the delete rows tool then the append tool instead of opening an edit session with a data access cursor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 19:28:13 GMT</pubDate>
    <dc:creator>BrendanDwyer</dc:creator>
    <dc:date>2014-07-18T19:28:13Z</dc:date>
    <item>
      <title>Edit Versioned Feature Class in python</title>
      <link>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255599#M1613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a versioned feature class in sde that is the source of a map service.&amp;nbsp; I can open the feature class in arc map, start an edit session, make edits and save those edits.&amp;nbsp; However, if I try to start an edit session in an arcpy script I get a schema lock.&amp;nbsp; I'm using the same user and sde connection file.&amp;nbsp; Shouldn't I be able to edit this feature class in arcpy?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 20:00:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255599#M1613</guid>
      <dc:creator>BrendanDwyer</dc:creator>
      <dc:date>2014-07-09T20:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Versioned Feature Class in python</title>
      <link>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255600#M1614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brendan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post the code you are using?&amp;nbsp; Here is an example of editing a versioned feature class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14049980143172340" jivemacro_uid="_14049980143172340" modifiedtitle="true"&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;import os&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;fc = 'Database Connections/VECTOR@SQLSERVER.sde/AddressPts'&lt;/P&gt;
&lt;P&gt;workspace = os.path.dirname(fc)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Start an edit session. Must provide the worksapce.&lt;/P&gt;
&lt;P&gt;edit = arcpy.da.Editor(workspace)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Edit session is started without an undo/redo stack for versioned data&lt;/P&gt;
&lt;P&gt;#&amp;nbsp; (for second argument, use False for unversioned data)&lt;/P&gt;
&lt;P&gt;edit.startEditing(False, True)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Start an edit operation&lt;/P&gt;
&lt;P&gt;edit.startOperation()&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Insert a row into the table.&lt;/P&gt;
&lt;P&gt;with arcpy.da.InsertCursor(fc, ('SHAPE@', 'Address')) as icur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; icur.insertRow([(601181.055124, 762555.994028), '120 Main St'])&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Stop the edit operation.&lt;/P&gt;
&lt;P&gt;edit.stopOperation()&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Stop the edit session and save the changes&lt;/P&gt;
&lt;P&gt;edit.stopEditing(True)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 13:13:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255600#M1614</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-07-10T13:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Versioned Feature Class in python</title>
      <link>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255601#M1615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;Thanks for responding.&amp;nbsp; I ended up using the append tool instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is that another department posts an excel file online and we want to update a feature class with the new data.&amp;nbsp; We want to completely replace the existing records with the new data.&amp;nbsp; So I am using the delete rows tool then the append tool instead of opening an edit session with a data access cursor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 19:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/edit-versioned-feature-class-in-python/m-p/255601#M1615</guid>
      <dc:creator>BrendanDwyer</dc:creator>
      <dc:date>2014-07-18T19:28:13Z</dc:date>
    </item>
  </channel>
</rss>

