Select to view content in your preferred language

AttributeError: 'Cursor' object has no attribute 'UpdateRow'

5089
2
01-26-2012 02:02 PM
mohd_syafidabdullah
Emerging Contributor
Hi Guru,

I'm newbie in python. I'm trying to update the row in FC using this code :
import arcpy
from arcpy import env

fc_input = "C:\GIS\syafid.gdb\Alamat_Pos"
rowUpdate = arcpy.UpdateCursor(fc_input)
rowUpd = rowUpdate.next()
space = " "

while rowUpd:
    address = rowUpd.getValue("BUILDING_NUMBER") + space + rowUpd.getValue("STREET_NAME") + space + rowUpd.getValue("PRECINCT_ID") + space + rowUpd.getValue("POST_CODE") + space + rowUpd.getValue("STATE_NAME")
    print rowUpd.objectID_1,address
    rowUpd.setValue("ALAMAT_POS",address)
    rowUpdate.UpdateRow(rowUpd)

del rowUpd,rowUpdate



I got the error like this
IDLE 2.6.5      ==== No Subprocess ====
>>> 
1 004 Jalan P8A/5 P08 0 Putrajaya
Traceback (most recent call last):
  File "D:\python_code\postal_address.py", line 14, in <module>
    rowUpdate.UpdateRow(rowUpd)
AttributeError: 'Cursor' object has no attribute 'UpdateRow'


Perhaps guru can guide me the right code..
thanks.
Tags (2)
0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus
dump the capital u in updateRow
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000
case-sensitive is Python Yoda says
0 Kudos
mohd_syafidabdullah
Emerging Contributor
dump the capital u in updateRow
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000
case-sensitive is Python Yoda says


Hi Dan,

Thanks for the solution. The code working now.
0 Kudos