Show Navigation | Hide Navigation
You are here:
Geoprocessing > Automating your work with scripts > Scripting object: Properties and Methods > Properties and Methods

UpdateCursor method

Release 9.3
Last modified January 19, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Properties and Methods"

Related Topics

Note: This topic was updated for 9.3.1.

Used to positionally update and delete rows in the specified table


object.UpdateCursor(InputValue As String, {WhereClause} As String, {SpatialReference} As Object, {FieldList} As String, {SortFields} As String) As Object

{} = optional

Part Description
object The instantiated geoprocessor object.
InputValue The table, feature class, or shapefile containing rows to be searched.
WhereClause Optional. An expression that limits the number of rows to be searched. For further information on WHERE clauses and Structured Query Language (SQL) statements, see About building an SQL statement.
SpatialReference Optional. The spatial reference of the input table, feature class, or shapefile.
FieldList Optional. Fields to be included in the cursor. By default, all fields are used.
SortFields Optional. Fields used to sort the rows. Ascending and descending order for each field is denoted by A and D.


import arcgisscripting
gp = arcgisscripting.create(9.3)

# Create update cursor for feature class
rows = gp.UpdateCursor("D:/St_Johns/data.mdb/roads")
row = rows.Next()

# Update the field used in buffer so the distance is based on the road
#   type. Road type is either 1, 2, 3 or 4. Distance is in meters.
while row:
    row.buffer_distance = row.road_type * 100
    row = rows.Next()

# Delete cursor and row objects to remove locks on the data
del row
del rows

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.