<?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 unable to &amp;amp;amp;quot;setValue&amp;amp;amp;quot; on a field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386733#M30523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm probably overlooking something obvious, but i'm unable to set a value on a field of a feature class.&amp;nbsp; Here is a short example to show what I am doing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import env

env.workspace = r"X:\temp"

fc = "temp.shp"


desc = arcpy.Describe( fc )

print 'Fields: '
for field in desc.fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Name: ', field.name, 'Type: ', field.type, 'Length: ', repr(field.length)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

rows = arcpy.SearchCursor( fc )

for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("S_T_R", "test")

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Fields: &lt;BR /&gt;Name:&amp;nbsp; FID Type:&amp;nbsp; OID Length:&amp;nbsp; 4&lt;BR /&gt;Name:&amp;nbsp; Shape Type:&amp;nbsp; Geometry Length:&amp;nbsp; 0&lt;BR /&gt;Name:&amp;nbsp; TOWNSHIP_N Type:&amp;nbsp; Double Length:&amp;nbsp; 11&lt;BR /&gt;Name:&amp;nbsp; TOWNSHIP_D Type:&amp;nbsp; String Length:&amp;nbsp; 1&lt;BR /&gt;Name:&amp;nbsp; RANGE_NUM Type:&amp;nbsp; Double Length:&amp;nbsp; 11&lt;BR /&gt;Name:&amp;nbsp; RANGE_DIR Type:&amp;nbsp; String Length:&amp;nbsp; 1&lt;BR /&gt;Name:&amp;nbsp; RECORD_NUM Type:&amp;nbsp; String Length:&amp;nbsp; 3&lt;BR /&gt;Name:&amp;nbsp; SECTION Type:&amp;nbsp; Double Length:&amp;nbsp; 11&lt;BR /&gt;Name:&amp;nbsp; ID_FIELD Type:&amp;nbsp; String Length:&amp;nbsp; 9&lt;BR /&gt;Name:&amp;nbsp; S_T_R Type:&amp;nbsp; String Length:&amp;nbsp; 12&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:/code/scripts/GIS/addS_T_R.py", line 20, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("S_T_R", "test")&lt;BR /&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 940, in setValue&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.SetValue(*gp_fixargs(args)))&lt;BR /&gt;RuntimeError: ERROR 999999: Error executing function.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any pointers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dustin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:46:05 GMT</pubDate>
    <dc:creator>DustinReagan</dc:creator>
    <dc:date>2021-12-11T17:46:05Z</dc:date>
    <item>
      <title>unable to &amp;amp;quot;setValue&amp;amp;quot; on a field</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386733#M30523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm probably overlooking something obvious, but i'm unable to set a value on a field of a feature class.&amp;nbsp; Here is a short example to show what I am doing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import env

env.workspace = r"X:\temp"

fc = "temp.shp"


desc = arcpy.Describe( fc )

print 'Fields: '
for field in desc.fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Name: ', field.name, 'Type: ', field.type, 'Length: ', repr(field.length)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

rows = arcpy.SearchCursor( fc )

for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("S_T_R", "test")

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Fields: &lt;BR /&gt;Name:&amp;nbsp; FID Type:&amp;nbsp; OID Length:&amp;nbsp; 4&lt;BR /&gt;Name:&amp;nbsp; Shape Type:&amp;nbsp; Geometry Length:&amp;nbsp; 0&lt;BR /&gt;Name:&amp;nbsp; TOWNSHIP_N Type:&amp;nbsp; Double Length:&amp;nbsp; 11&lt;BR /&gt;Name:&amp;nbsp; TOWNSHIP_D Type:&amp;nbsp; String Length:&amp;nbsp; 1&lt;BR /&gt;Name:&amp;nbsp; RANGE_NUM Type:&amp;nbsp; Double Length:&amp;nbsp; 11&lt;BR /&gt;Name:&amp;nbsp; RANGE_DIR Type:&amp;nbsp; String Length:&amp;nbsp; 1&lt;BR /&gt;Name:&amp;nbsp; RECORD_NUM Type:&amp;nbsp; String Length:&amp;nbsp; 3&lt;BR /&gt;Name:&amp;nbsp; SECTION Type:&amp;nbsp; Double Length:&amp;nbsp; 11&lt;BR /&gt;Name:&amp;nbsp; ID_FIELD Type:&amp;nbsp; String Length:&amp;nbsp; 9&lt;BR /&gt;Name:&amp;nbsp; S_T_R Type:&amp;nbsp; String Length:&amp;nbsp; 12&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:/code/scripts/GIS/addS_T_R.py", line 20, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("S_T_R", "test")&lt;BR /&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 940, in setValue&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.SetValue(*gp_fixargs(args)))&lt;BR /&gt;RuntimeError: ERROR 999999: Error executing function.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any pointers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dustin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:46:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386733#M30523</guid>
      <dc:creator>DustinReagan</dc:creator>
      <dc:date>2021-12-11T17:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: unable to "setValue" on a field</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386734#M30524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;setValue only works with insertcursor or updatecursors, check the help&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 17:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386734#M30524</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-07-29T17:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: unable to "setValue" on a field</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386735#M30525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;setValue only works with insertcursor or updatecursors&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you! I knew I was overlooking something obvious...I looked at this help page multiple times, but overlooked the different cursor types!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 17:53:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-amp-amp-quot-setvalue-amp-amp-quot-on-a/m-p/386735#M30525</guid>
      <dc:creator>DustinReagan</dc:creator>
      <dc:date>2011-07-29T17:53:05Z</dc:date>
    </item>
  </channel>
</rss>

