Cursor Update Issue

769
3
12-02-2011 07:18 AM
JeremyLuymes
New Contributor III
Hi,

I have created a fairly simple script to capitalize a field. The field name is "STREET". I Have tried using !STREET! or STREET but this does not work either. I get the following error message:

Traceback (most recent call last):
  File "M:\Scripts\StreetFormat.py", line 32, in <module>
    value = row.GetValue("STREET")
AttributeError: 'builtin_function_or_method' object has no attribute 'GetValue'

Any solutions?
import arcgisscripting, sys, os
gp=arcgisscripting.create(9.3)

main = "M:\Scripts\Export_Output.shp"

cur = gp.UpdateCursor(main)
row = cur.next
while row:
    value = row.GetValue("STREET")
    valueUpper = value.upper()
    row.SetValue("STREET", valueUpper)
    cur.UpdateRow(row)
    row = cur.Next()
del cur, row
Tags (2)
0 Kudos
3 Replies
JeremyLuymes
New Contributor III
Note: indentation is correct just didn't copy correctly
0 Kudos
JeremyLuymes
New Contributor III
Forgot () after row=cur.next

Works now.
0 Kudos
Luke_Pinner
MVP Regular Contributor
Note: indentation is correct just didn't copy correctly

If you use the CODE tag (the "#" button in the editor toolbar above where you type your post) than the indentation will be preserved.
0 Kudos