Update Column

Feature Description

The Update Column function allows batch modification of attribute values for specified fields in the current attribute table according to specific conditions or rules, facilitating efficient data entry and field value updates.

Available when cells are selected in the attribute table.

Feature Entry

  • Table Tab->Edit->Update Column button.
  • Toolbox->Data Processing->Vector->Update Column.
  • Table window context menu->Update Column button.

Parameter Description

  • Field to Update: Select target field from the dropdown list.
  • Update Scope: Provides two update modes:
    • Entire Field: Updates all values in the specified field.
    • Selected Records: Updates only selected cells in the specified field.
  • Value Source: Specifies the source of updated values, including Unified Value, Single-Field, Double-Field, and Function.
Value Source Description
Unified Value Updates all cells in the specified scope with a uniform value.
Single-Field

Constructs mathematical expressions using a specified field and user-defined value (e.g., SmID + 100) to update target cells.

For each record in the update scope, calculates new values using the specified field value, operator, and operand.

Double-Field

Builds expressions using two specified fields (e.g., SmID + SmUserID) to update target cells.

For each record in the update scope, calculates new values using values from two specified fields and operator.

Function

Applies predefined functions to specified fields (e.g., Abs(SmID)) to update target cells.

For each record in the update scope, calculates new values using the specified field value and function.

  • Reverse Operands: When using Single/Double-Field sources, checking this box swaps operands in expressions.
  • Update Value: Input value assigned to the target field. Note: For fields with enumerated domains, values can be assigned using enumeration codes or descriptions.
  • Operand Field: Specifies the field used for constructing expressions when using Single-Field or Function sources.
  • First/Second Operand Fields: Specifies fields for Double-Field expression construction.
  • Operator: Specifies arithmetic operations (+, -, ×, /, %) for Single/Double-Field sources.
Operator Description
+ (Add)

Numerical addition or string concatenation (strings support only + operator).

- (Subtract)

Numerical subtraction (minuend - subtrahend).

× (Multiply)

Numerical multiplication.

/ (Divide)

Numerical division. Returns dividend if divisor is zero.

% (Modulo)

Numerical remainder operation. Returns dividend if divisor is zero.

  • Function: Specifies calculation functions when using Function source.
    • Parameter fields accept additional function parameters. See Operation Functions.
    • Users can create custom expressions via SQL Expression dialog when predefined functions are insufficient.
  • Expression: Displays/edit calculation expressions. Click the combo box button to open SQL Expression dialog for advanced editing. See SQL Expression Query.

Different database engines require specific expression formats for Single-Field updates:

Datasource Type Notes
UDB

Prepend ifnull() for Boolean/Text fields.
E.g.: ifnull(char_1,'') || 'a'

UDBX

Handle Boolean/Text fields same as UDB.

Oracle/OracleSpatial

Replace BigInt with number(37) for Long fields.
E.g.: nvl(Int64_1,0)+cast(1 as number(37))

PostGIS/PostgreSQL

① Use coalesce() for Single-Field expressions.
② Replace Double with numeric for double fields.
③ Text fields not supported.

MySQL

① Use ifnull() for Single-Field expressions.
② Use signed for integer fields.
③ Use decimal(38,16) for float fields.
④ Use CONCAT() instead of || for text fields.

SQL Server

① Use ifnull() for Single-Field expressions.
② Text fields not supported.
③ Boolean fields support only +/- operators.

Related Topics

Calculate Geometry Attributes

Reclassify Field

Update Column (ToDate)

Delete/Add Rows

Undo/Redo

Attribute Table Copy/Paste

Binary Field Editing