<?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: Setting up an edit session Via versioned SDE to a table, and using updateCursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400614#M70164</link>
    <description>&lt;P&gt;The error is occurring exactly at the updateCursor, it wont even reach a print statement on the next line.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Good idea with trying with a local FGDB copy, I'll give that a go! And if that works, we can determine that there is likely an issue with permissions?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2024 21:51:44 GMT</pubDate>
    <dc:creator>EdX1</dc:creator>
    <dc:date>2024-03-25T21:51:44Z</dc:date>
    <item>
      <title>Setting up an edit session Via versioned SDE to a table, and using updateCursor</title>
      <link>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1398106#M70090</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am having some difficulties using an updateCursor. I am running this script via the python terminal within ArcPro. When I run the updateCrusor, it hangs for 30+ minutes then has an error, "error: cannot update table". Can someone please verify that I have set up the cursor and edit session correctly, and provide any insight into why it might not work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have the following variables:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sTable_path = r" path... @SDE.sde\SDE.Serv_TEST_FILE" #full path to the table
SDE_Workspace_Path = r" path... @SDE.sde" #path to the SDE connection
sTab = r"SDE.Serv_TEST_FILE" #table name #name of the table I want to update&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I then set up my edit session and attempt to do some updates, it gets stuck at the updateCursor.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;        edit = arcpy.da.Editor(SDE_Workspace_Path) #opening workspace path
        edit.startEditing(False, True) 
        edit.startOperation()
        try:

            print("Retiring old assessment(s)...") 


            with arcpy.da.UpdateCursor(sTable_path, ("RecordStatus", "Retired"), where_clause=sOldWhere) as oRows:&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't seem to matter if I use sTable_path or sTab in the updateCursor, both cause it to hang. I've checked if the item is locked.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.TestSchemaLock(&lt;/SPAN&gt;&lt;SPAN&gt;sTable_path&lt;/SPAN&gt;&lt;SPAN&gt;) returns True, so the item should be able to be edited. Is there anything else I should check if it is a table lock issue?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Mar 2024 21:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1398106#M70090</guid>
      <dc:creator>EdX1</dc:creator>
      <dc:date>2024-03-19T21:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up an edit session Via versioned SDE to a table, and using updateCursor</title>
      <link>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1398727#M70103</link>
      <description>&lt;P&gt;Does adding in the Fields list as a List of fields make a difference (replace parrens with backets)?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;with arcpy.da.UpdateCursor(sTable_path, ["RecordStatus", "Retired"], where_clause=sOldWhere) as oRows:&lt;/LI-CODE&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 20:48:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1398727#M70103</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-03-20T20:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up an edit session Via versioned SDE to a table, and using updateCursor</title>
      <link>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400155#M70149</link>
      <description>&lt;P&gt;This does not make any difference, still stuck processing for a long period of time, eventually erroring out with message 'error updating table' after ~1 hour&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2024 22:24:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400155#M70149</guid>
      <dc:creator>EdX1</dc:creator>
      <dc:date>2024-03-24T22:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up an edit session Via versioned SDE to a table, and using updateCursor</title>
      <link>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400364#M70153</link>
      <description>&lt;P&gt;The edit session is started the same way I do successfully on versioned data "Moving edits to base'.&lt;/P&gt;&lt;P&gt;Is it erroring out trying to establish the cursor, or trying to stop/save the edit session?&lt;/P&gt;&lt;P&gt;With the code supplied, not sure what else to check except maybe your where_clause.&amp;nbsp; Have you printed it, or tried it in a makefeaturelayer to ensure it is filtering as suspected?&lt;/P&gt;&lt;P&gt;Have you tried with a FGDB copy of the dataset?&amp;nbsp; Might help figure out if it is something with the edit session, locks, corrupt data, etc.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 14:59:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400364#M70153</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-03-25T14:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up an edit session Via versioned SDE to a table, and using updateCursor</title>
      <link>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400614#M70164</link>
      <description>&lt;P&gt;The error is occurring exactly at the updateCursor, it wont even reach a print statement on the next line.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Good idea with trying with a local FGDB copy, I'll give that a go! And if that works, we can determine that there is likely an issue with permissions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 21:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-up-an-edit-session-via-versioned-sde-to-a/m-p/1400614#M70164</guid>
      <dc:creator>EdX1</dc:creator>
      <dc:date>2024-03-25T21:51:44Z</dc:date>
    </item>
  </channel>
</rss>

