GeoEco.Datasets.UpdateCursor.SetValue
- UpdateCursor.SetValue(field, value)
Sets the value of a field of the current row, given the name of the field and its new value.
Note
Changes to the row are not actually submitted through the underlying programming library to the underlying data store until
UpdateRow()is called. If you callSetValue()but then neglect to callUpdateRow()before callingNextRow(), your changes will be lost.- Parameters:
field (
str) –Name of the field to set the value of.
If you specified a list of fields to retrieve when you opened the cursor, you will only be able to set the values of those fields. If you did not specify such a list, then you will be able to set all of the fields of the
Table.This function cannot be used to set the geometry of the row, even if the underlying data format stores the geometry in a named field. Use
SetGeometry()instead.This function cannot be used to set the ArcGIS “object ID” field. That field is read-only and managed by the underlying data store or programming library used to access it.
The underlying data store or programming library may expose other read-only fields. For example, some versions of ArcGIS maintain fields called
Shape_LengthandShape_Areain feature classes of ArcGIS geodatabases. These may not be set either. To determine if a field may be set, callGetFieldByName()on theTableand examine theIsSettableproperty of the returnedFieldinstance.Minimum length꞉ 1.
value (
object) –Value of the field.
To set the field to a database NULL, use
None. Otherwise, you must provide an instance of the Python type that is appropriate for the data type of the field:Field Data Type
Appropriate Python Type
binary
date, datetime
float32, float64
int16, int32
string
To determine the data type of a field, call
GetFieldByName()on theTableand examine theDataTypeproperty of the returnedFieldinstance.