Feature Operations
Many writers share a Feature Operation specification, which determines whether incoming features will be inserted, updated, or deleted from the destination tables.
Note: Feature Operation supersedes Writer Mode.
Feature Operation is a writer format parameter. Its possible values are:
- Insert: Append rows onto the destination table using attributes (and geometries if writer is spatial) on features.
- Update: Update existing table columns using attributes (and geometries if writer is spatial) on features. A selection method must be specified in the Row Selection group.
- Delete: Delete existing table rows. A selection method must be specified in the Row Selection group.
- fme_db_operation: The feature operation will be determined by the attribute fme_db_operation on each input feature. A selection method must be specified in the Row Selection group. The value of fme_db_operation will be processed as follows:
- If the value is null, empty, or missing, it will be treated as Insert.
- The value will next be matched to Insert, Update, and Delete, case insensitively.
- If there is no match, the feature will be rejected with a warning in the log.
- If there is a match, the matched feature operation will be performed on the feature.
Update Spatial Column(s) is a writer format parameter that is in effect only when the feature operation for a feature is Update. Possible values for this parameter are:
- Yes: The spatial column(s) specified by the user will be updated. IFMENulls will be written as null values and replace existing spatial values. Some exceptions exist for multiple geometry column handling.
- No: No spatial column will be updated.
Row Selection is a writer format parameter group that is in effect only when the feature operation for a feature is Update or Delete. When updating and deleting from a table, a condition needs to be specified for selecting which rows to operate on. This parameter group offers two ways to construct the selection condition:
- Match Columns: The column(s) chosen in the corresponding column picker dialog will be used for matching destination rows. All matching rows will be selected for update or delete. If any feature attributes corresponding to the specified match columns contain null or missing values, the feature will be rejected.
- WHERE Clause: The corresponding WHERE Clause Builder lets you construct a WHERE clause. You can also type in a WHERE clause inline, without launching the WHERE Clause Builder. It is optional to start the clause with the keyword WHERE.
- The WHERE Clause Builder makes it easy for users to reference feature attribute values, destination table columns, and invoke FME functions. The WHERE clause is first evaluated as an FME expression, before being applied onto the destination table.
- The user can set the WHERE clause to any attribute on the feature. For existing FME users, the familiar fme_where attribute now must be specified via WHERE Clause for it to take effect (see example above).
- If the WHERE clause is invalid, the feature will be rejected or the translation will fail, depending on the specific writer.
- For advanced users, conditional WHERE clauses can be created through the Conditional Value editor, to accommodate different groups of features.
See also: Writer Mode