GeoEco.Datasets.InsertCursor.SetValue
- InsertCursor.SetValue(field, value)
Sets the value of a field of the new row, given the name of the field and its value.
Note
The new row is not actually submitted through the underlying programming library to the underlying data store until
InsertRow()is called. If you callSetValue()but then neglect to callInsertRow()before closing the cursor, your row will not be inserted.- Parameters:
field (
str) –Name of the field to set the value of.
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.