GeoEco.Datasets.ArcGIS.ArcGISTable.OpenUpdateCursor

ArcGISTable.OpenUpdateCursor(fields=None, where=None, orderBy=None, rowCount=None, reportProgress=True, rowDescriptionSingular=None, rowDescriptionPlural=None)

Opens and returns an UpdateCursor for reading, updating, and deleting rows from the table.

Parameters:
  • fields (list of str, optional) –

    List of fields to retrieve. If None, the default, all fields will be retrieved. Do not provide '*', as would be done in a SQL SELECT statement that wanted to retrieve all fields.

    This usual reason to not retrieve all of the fields is to minimize database and network load. If you do not have these concerns, there is no reason to provide a value for this parameter.

    If you do provide a list of fields and the table has a geometry field and you want it to be able to access it (e.g. with GetGeometry()), be sure you include the geometry field in your list. The GeometryFieldName property gives the name of the geometry field.

    Minimum length꞉ 1.

  • where (str, optional) –

    SQL WHERE clause expression that specifies the rows to include. If not provided, all of the rows will be included. If provided but the underlying storage format does not support WHERE clauses, an exception will be raised.

    The exact syntax of this expression depends on the underlying storage format. If the underlying data store will be accessed through ArcGIS, this article may document some of the possible syntax, but not all of it may be supported through ArcGIS’s underlying Python API.

    Minimum length꞉ 1.

  • orderBy (str, optional) –

    SQL ORDER BY clause that specifies the order in which the rows should be accessed. If not provided, the rows will accessed according to the default behavior of the underlying storage format and the programming library used to access it.

    The ORDER BY clause must be a comma-separated list of fields. Each field can optionally be followed by a space and the word ASC to indicate ascending order or DESC to indicate descending order. If neither is specified, ASC is assumed.

    The underlying storage format and library perform the actual evaluation of this parameter and determine the rules of sorting, such as whether string comparisons are case-sensitive or case-insensitive. At present, there is no mechanism to interrogate or manipulate these rules; you must live with the default behavior of the underlying format and library.

    Minimum length꞉ 1. Must match regular expression꞉ \s*\S+(\s+([aA][sS][cC]|[dD][eE][sS][cC]))?\s*(,\s*\S+(\s+([aA][sS][cC]|[dD][eE][sS][cC]))?\s*)*.

  • rowCount (int, optional) –

    Number of rows that will be accessed, if it is known ahead of time. If the number of rows is not known, omit this parameter.

    This parameter is only used in progress reporting and is ignored if reportProgress is False. If this parameter is provided, the progress reports will include the number of rows remaining and an estimated time of completion. If not provided, the progress reports will only include the number of rows accessed so far.

    Minimum value꞉ 0.

  • reportProgress (bool, optional) – If True, progress messages will be logged periodically as the query proceeds.

  • rowDescriptionSingular (str, optional) – Word to use in progress and error messages for a single row. If omitted, an appropriate generic word will be automatically selected based on the table’s geometry type, such as “point”, “line”, “polygon”, and so on. If the table does not have geometry, “row” will be used. Minimum length꞉ 1.

  • rowDescriptionPlural (str, optional) – Word to use in progress and error messages for plural rows. If omitted, an appropriate generic word will be automatically selected based on table’s geometry type, such as “points”, “lines”, “polygons”, and so on. If the table does not have geometry, “rows” will be used. Minimum length꞉ 1.

Returns:

Opened UpdateCursor positioned on the first row (if any rows were returned).

Return type:

UpdateCursor