<?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 Editing data in Non Versioned SDE using python with a updatecursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498708#M39141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that calculates &amp;nbsp;x coordinates , y &lt;SPAN&gt;coordinates&lt;/SPAN&gt;&amp;nbsp;for a point geometry that sits within a feature dataset of an SDE (SQL Express). The script worked fine on a file geodatabase however when it runs on the SDE feature class, it stalls at the updateCursor function&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; "ERROR: 999999: Error executing function....Objects in the class cannot be updated outside an edit session [FSB.DBO.Structures]" &amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script breaks on &lt;EM&gt;updCursor.updateRow(row):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; 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;&lt;SPAN class="string token"&gt;"insertworkspace"&lt;/SPAN&gt;
edit &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;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

updCursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;projectedFC&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; spatialRef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; updCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;POINT_X &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pnt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X
&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;POINT_Y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pnt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; updCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; updCursor&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row

edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;If anyone has any information, ideas or input on editing data in non versioned SDE with a updatecursor using python it would be greatly appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:54:43 GMT</pubDate>
    <dc:creator>JenniferMcCarthy</dc:creator>
    <dc:date>2021-12-11T21:54:43Z</dc:date>
    <item>
      <title>Editing data in Non Versioned SDE using python with a updatecursor</title>
      <link>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498708#M39141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that calculates &amp;nbsp;x coordinates , y &lt;SPAN&gt;coordinates&lt;/SPAN&gt;&amp;nbsp;for a point geometry that sits within a feature dataset of an SDE (SQL Express). The script worked fine on a file geodatabase however when it runs on the SDE feature class, it stalls at the updateCursor function&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; "ERROR: 999999: Error executing function....Objects in the class cannot be updated outside an edit session [FSB.DBO.Structures]" &amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script breaks on &lt;EM&gt;updCursor.updateRow(row):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; 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;&lt;SPAN class="string token"&gt;"insertworkspace"&lt;/SPAN&gt;
edit &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;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

updCursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;projectedFC&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; spatialRef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; updCursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;POINT_X &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pnt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X
&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;POINT_Y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pnt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; updCursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; updCursor&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row

edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;If anyone has any information, ideas or input on editing data in non versioned SDE with a updatecursor using python it would be greatly appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498708#M39141</guid>
      <dc:creator>JenniferMcCarthy</dc:creator>
      <dc:date>2021-12-11T21:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Editing data in Non Versioned SDE using python with a updatecursor</title>
      <link>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498709#M39142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jennifer, it would help if you look at &lt;A href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=d8be959b-4c74-45a6-8490-e32462157d74&amp;amp;searchIndex=2"&gt;https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=d8be959b-4c74-45a6-8490-e32462157d74&amp;amp;searchIndex=2&lt;/A&gt;‌&amp;nbsp;&amp;nbsp; and repost your code.&amp;nbsp; Spacing/indenting is critical in python and debugging for other is hard when that would be the issue.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 18:04:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498709#M39142</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-01-12T18:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Editing data in Non Versioned SDE using python with a updatecursor</title>
      <link>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498710#M39143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Rebecca, the changes have been made!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 18:14:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498710#M39143</guid>
      <dc:creator>JenniferMcCarthy</dc:creator>
      <dc:date>2017-01-12T18:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Editing data in Non Versioned SDE using python with a updatecursor</title>
      <link>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498711#M39144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would look thru the samples &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/editor.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/editor.htm"&gt;Editor—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; but with a quick look, I would suggest 1) full path to the feature class, and 2) you may need to use MakeFeatureLayer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if you are just trying to update coordinates values in the table (not moving the points themselves)&amp;nbsp; maybe look at&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-xy-coordinates.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-xy-coordinates.htm"&gt;Add XY Coordinates—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-geometry-attributes.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-geometry-attributes.htm"&gt;Add Geometry Attributes—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 18:26:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498711#M39144</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-01-12T18:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Editing data in Non Versioned SDE using python with a updatecursor</title>
      <link>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498712#M39145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/127179" target="_blank"&gt;Jennifer McCarthy&lt;/A&gt;‌ the below should work on a Non-Versioned SDE Geodatabase:&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;# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(workspace)
# Edit session is started without an undo/redo stack for versioned data
#  (for second argument, use False for unversioned data)
edit.startEditing(True, False)

with arcpy.da.UpdateCursor("Your Parameters") as cursor:
    # Start an edit operation
    edit.startOperation()
    for row in cursor:

    # Your Code Here&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Stop the edit operation.
edit.stopOperation()

# Stop the edit session and save the changes
edit.stopEditing(True)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-data-in-non-versioned-sde-using-python/m-p/498712#M39145</guid>
      <dc:creator>CamMuller</dc:creator>
      <dc:date>2021-12-12T16:32:49Z</dc:date>
    </item>
  </channel>
</rss>

