<?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: Update Cursor not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24007#M1804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe an overly simplistic observation, but in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt; if str(row.getValue("STRUCTURE_ID")) == 'None':&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the 'None' meant to be a string or should it just be None for NoData? The way you have it now the conditional will only trigger if there's actually the string 'None' in those cells.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Feb 2014 17:32:21 GMT</pubDate>
    <dc:creator>ClintDow</dc:creator>
    <dc:date>2014-02-12T17:32:21Z</dc:date>
    <item>
      <title>Update Cursor not working</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24006#M1803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have this update cursor. The code executes in LiClipse without an error at all but none of my rows update in SDE. Am I missing a step?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jordan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# stupidtest.py
# Created on: 2014-02-06 11:56:15.00000
#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy
import arceditor

arg_sdeDEV_sde = "Database Connections\\arg@sdeDEV.sde"
ARG_ACCESS_OPENING = "Database Connections\\arg@sdeDEV.sde\\ARG.DistributionSystem\\ARG.ACCESS_OPENING"
ACCESS_OPENING_Layer = "ACCESS_OPENING_Layer"

# Process: Make Feature Layer
arcpy.env.workspace = "Database Connections\\arg@sdeDEV.sde"
arcpy.env.overwriteOutput = True
arcpy.MakeFeatureLayer_management(ARG_ACCESS_OPENING, ACCESS_OPENING_Layer, "", arg_sdeDEV_sde, "OBJECTID OBJECTID VISIBLE NONE;OPEN_TYPE OPEN_TYPE VISIBLE NONE;REC_INFO_NAME REC_INFO_NAME VISIBLE NONE")

# Process: Start Edit
edit = arcpy.da.Editor(arcpy.env.workspace)
edit.startEditing(False, True)
edit.startOperation()

# Process: Select and Update Data
cursor = arcpy.UpdateCursor(ARG_ACCESS_OPENING)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if str(row.getValue("STRUCTURE_ID")) == 'None':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.STRUCTURE_ID = str(row.getValue("ENCLOSURE_ID"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del cursor, row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
print 'done'
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 13:31:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24006#M1803</guid>
      <dc:creator>JordanParfitt</dc:creator>
      <dc:date>2014-02-12T13:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update Cursor not working</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24007#M1804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe an overly simplistic observation, but in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt; if str(row.getValue("STRUCTURE_ID")) == 'None':&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the 'None' meant to be a string or should it just be None for NoData? The way you have it now the conditional will only trigger if there's actually the string 'None' in those cells.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 17:32:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24007#M1804</guid>
      <dc:creator>ClintDow</dc:creator>
      <dc:date>2014-02-12T17:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Update Cursor not working</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24008#M1805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All of my code is executing. It makes it pass that if statement and even if I remove the if statement it doesn't work either. The database just isn't being updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.STRUCTURE_ID = str(row.getValue("ENCLOSURE_ID"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:58:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-not-working/m-p/24008#M1805</guid>
      <dc:creator>JordanParfitt</dc:creator>
      <dc:date>2021-12-10T20:58:27Z</dc:date>
    </item>
  </channel>
</rss>

