<?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: Cannot open workspace in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402017#M31654</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for ur reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yes, It is editing manually with the standard &lt;SPAN style="background-color: #ffffff;"&gt;license.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Kamyaka&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Feb 2018 13:07:52 GMT</pubDate>
    <dc:creator>KamyakaKasani</dc:creator>
    <dc:date>2018-02-06T13:07:52Z</dc:date>
    <item>
      <title>Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402015#M31652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Getting the error "cannot open workspace" while using arcpy.da.Editor(arcpy.env.workspace) for a versioned data&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kamyaka&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 12:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402015#M31652</guid>
      <dc:creator>KamyakaKasani</dc:creator>
      <dc:date>2018-02-06T12:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402016#M31653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume that you have the right license level available to start the editing on that workspace? Is it a Enterprise GDB (would require Standard or up). When you manually start editing on that workspace, does that work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 12:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402016#M31653</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-02-06T12:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402017#M31654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for ur reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yes, It is editing manually with the standard &lt;SPAN style="background-color: #ffffff;"&gt;license.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Kamyaka&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 13:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402017#M31654</guid>
      <dc:creator>KamyakaKasani</dc:creator>
      <dc:date>2018-02-06T13:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402018#M31655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you look at the second example down below on this page&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/editor.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/editor.htm"&gt;Editor—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;you can see the sequence of commands you should use.&amp;nbsp; Can you post your code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 13:31:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402018#M31655</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-02-06T13:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402019#M31656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And make sure you are specifying&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;Path to the workspace to edit. Editor can edit only one workspace at a time&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and not the FC. That sometimes is something that is overlooked.&amp;nbsp; As Xander pointed out, check out the samples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 16:35:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402019#M31656</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2018-02-06T16:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402020#M31657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my&amp;nbsp;sample code&lt;/P&gt;&lt;P&gt;path = 'D:\\temp'&lt;BR /&gt; connection = "test1.sde"&lt;/P&gt;&lt;P&gt;arcpy.CreateDatabaseConnection_management(path,&lt;BR /&gt; connection,&lt;BR /&gt; "ORACLE",&lt;BR /&gt;instanse,&lt;BR /&gt; "DATABASE_AUTH",&lt;BR /&gt; "test",&lt;BR /&gt;XXX,&lt;BR /&gt; "SAVE_USERNAME",&lt;BR /&gt; "",&lt;BR /&gt;database,&lt;BR /&gt; "TRANSACTIONAL",&lt;BR /&gt;&amp;lt;version_name&amp;gt;,"")&lt;/P&gt;&lt;P&gt;tablePath = path + "\\" + connection&amp;nbsp;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = tablePath&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(arcpy.env.workspace,[&amp;lt;field_name&amp;gt;], where) as cur:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# updatecursor stuff come here&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 04:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402020#M31657</guid>
      <dc:creator>KamyakaKasani</dc:creator>
      <dc:date>2018-02-07T04:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402021#M31658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, is this a script that will only be run 1 time or do you want to run it multiple times? If multiple times, it would be better to use an existing connection or check if it has already bee created. Creating a sde connection on the fly, requires additional like having the Oracle client 32 bits (ArcMap) and/or Oracle client 64 bits (ArcGIS Pro) installed and working and tnsnames.ora and sqlnet.ora configured properly (to name a few requirements).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the sample code that both Rebecca and I mentioned earlier:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Database Connections/Portland.sde/portland.jgp.schools'&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Start an edit session. Must provide the workspace.&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;

&lt;SPAN class="comment token"&gt;# Edit session is started without an undo/redo stack for versioned data&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp; (for second argument, use False for unversioned data)&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;

&lt;SPAN class="comment token"&gt;# Start an edit operation&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;

&lt;SPAN class="comment token"&gt;# Insert a row into the table.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Name'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; icur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; icur&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7642471.100&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;686465.725&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'New School'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Stop the edit operation.&lt;/SPAN&gt;
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;

&lt;SPAN class="comment token"&gt;# Stop the edit session and save the changes&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;/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;... you can see&amp;nbsp;there is a sequence of steps to be followed:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;you have you path to your feature class to be edited (line 4)&lt;/LI&gt;&lt;LI&gt;you determine the "path" (sde connection) which will be your workspace (line 5)&lt;/LI&gt;&lt;LI&gt;you create an editor object on your workspace (sde connection)&amp;nbsp; at line 8&lt;/LI&gt;&lt;LI&gt;you start editing (see line 12) configuring that you want to edit versioned data&lt;/LI&gt;&lt;LI&gt;your start the edit operation (line 15)&lt;/LI&gt;&lt;LI&gt;on line 18 you start your update cursor with the logic you want to apply&lt;/LI&gt;&lt;LI&gt;at the end you stop your edit operation (line 22)&lt;/LI&gt;&lt;LI&gt;and finally you stop editing saving your edits (if they were successful) see line 25&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of business logic will you be applying inside the cursor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:19:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402021#M31658</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T18:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402022#M31659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using Updatecursor logic all are working fine but while updating the row its getting failed at the statement&amp;nbsp;&lt;/P&gt;&lt;P&gt;RuntimeError: The requested operation is invalid on a closed state&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit; font-size: 14px;"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit; font-size: 14px;"&gt;import&lt;/SPAN&gt; os

fc &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;'Database Connections/Portland.sde/portland.jgp.schools'&lt;/SPAN&gt;
workspace &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Start an edit session. Must provide the workspace.&lt;/SPAN&gt;
edit &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit; font-size: 14px;"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Edit session is started without an undo/redo stack for versioned data&lt;/SPAN&gt;
&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;#&amp;nbsp; (for second argument, use False for unversioned data)&lt;/SPAN&gt;
edit&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit; font-size: 14px;"&gt;False&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit; font-size: 14px;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Start an edit operation&lt;/SPAN&gt;
edit&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;startOperation&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Insert a row into the table.&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit; font-size: 14px;"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.UpdateCursor&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;"&gt;'Name'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit; font-size: 14px;"&gt;as&lt;/SPAN&gt; ucur&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;:
&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in ucur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = '222'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucur.updateRow(row)&amp;nbsp;&amp;nbsp;&amp;nbsp; # Failing at this case


&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Stop the edit operation.&lt;/SPAN&gt;
edit&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;stopOperation&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit; font-size: 14px;"&gt;# Stop the edit session and save the changes&lt;/SPAN&gt;
edit&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;.&lt;/SPAN&gt;stopEditing&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit; font-size: 14px;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:19:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402022#M31659</guid>
      <dc:creator>KamyakaKasani</dc:creator>
      <dc:date>2021-12-11T18:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402023#M31660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should have failed on the line before also:&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;row[1] = '222'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will not work since the index should be 0 and not 1. You only have 1 field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I don't think you have a featureclass and connection called like this:}&lt;/P&gt;&lt;P&gt;fc = 'Database Connections/&lt;STRONG&gt;Portland.sde&lt;/STRONG&gt;/&lt;STRONG&gt;portland.jgp.schools&lt;/STRONG&gt;'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 12:12:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402023#M31660</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-02-07T12:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402024#M31661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Here is my code&amp;nbsp;
mxd = arcpy.mapping.MapDocument("CURRENT")
 for lyr in arcpy.mapping.ListLayers(mxd):
 if lyr.name == 'test':
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("SERVICEPROPERTIES"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servProp = lyr.serviceProperties

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = 'D:\\temp'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connection = "ttene71.sde"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = "test"
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where = 'OBJECTID = 1' #35585
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateDatabaseConnection_management(path,connection,"ORACLE",&amp;lt;instance&amp;gt;,"DATABASE_AUTH",&amp;lt;user_name&amp;gt;,&amp;lt;password&amp;gt;,"SAVE_USERNAME","",&amp;lt;password&amp;gt;,"TRANSACTIONAL",&amp;lt;version_name&amp;gt;,"")
 
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbc = 'Database Connections//test1.sde'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspace = os.path.dirname(dbc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor = arcpy.da.Editor(workspace)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor.startEditing(False,True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor.startOperation()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor = arcpy.da.UpdateCursor(lyr,['OBJECTID','NAME'], where)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = '222' 
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row) # getting the error here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor.stopOperation() 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor.stopEditing(True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del editor
&amp;nbsp; 
 del mxd &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402024#M31661</guid>
      <dc:creator>KamyakaKasani</dc:creator>
      <dc:date>2021-12-11T18:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot open workspace</title>
      <link>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402025#M31662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/310752"&gt;Kamyaka Kasani&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;It looks like you are opening several thread that are related to the same issue?&amp;nbsp; It is better to only post one, and if you have more information to help the original post, you can edit you post to add it (you can even change the title...but only if it help clarify...otherwise is can be confusing).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are tips on posting &lt;A href="https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-to-ask-questions-and-get-answers?sr=search&amp;amp;searchId=55610eae-6c40-4925-9242-d5f4c4853a33&amp;amp;searchIndex=7"&gt;https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-to-ask-questions-and-get-answers?sr=search&amp;amp;searchId=55610eae-6c40-4925-9242-d5f4c4853a33&amp;amp;searchIndex=7&lt;/A&gt;‌&amp;nbsp; and any code can be posted using &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=dd5239d4-49ff-4661-80b7-babe88e70b5e&amp;amp;searchIndex=6"&gt;https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=dd5239d4-49ff-4661-80b7-babe88e70b5e&amp;amp;searchIndex=6&lt;/A&gt;‌&amp;nbsp; &amp;nbsp;This help every one know if spacing is correct (critical for Python) and be able to refer to the same line number.&amp;nbsp; (see &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ code blocks vs your code blocks)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for reference, I think the other related posts are:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/209285"&gt;The requested operation is invalid on a closed state &lt;/A&gt;&amp;nbsp; (#748417)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/209286"&gt;The requested operation is invalid on a closed state&lt;/A&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(#748418)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/209286"&gt;The requested operation is invalid on a closed state&lt;/A&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (#748387)&lt;/P&gt;&lt;P&gt;and this one which is post #748389&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having the relative responses in one post with ovoid duplication and will help others find a solution in the future.&amp;nbsp; If there are no responses to some of the other posts, you can actually delete them...but only do so if there is no information, or if it is already included in another post.&amp;nbsp; Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 15:26:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-open-workspace/m-p/402025#M31662</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2018-02-07T15:26:59Z</dc:date>
    </item>
  </channel>
</rss>

