SQLite 3 Spatial (FDO) Writer Mode Specification
The SQLite3 writer allows the user to specify a writer mode, which determines what database command should be issued for each feature received. Valid writer modes are Insert, Update, and Delete.
Writer Modes
In Insert mode, the attribute values of each received feature are written as a new database record.
In Update mode, the attribute values of each received feature are used to update existing records in the database. The records which are updated are determined via the Feature Type parameters, or via the fme_where attribute on the feature.
In Delete mode, existing database records are deleted according to the information specified in the received feature. Records are selected for deletion using the same technique as records are selected for updating in Update mode.
Writer Mode Constraints
Specifies which SQL operations will be performed by default by this writer. This default writer-level value can be overwritten at the feature type or table level.
- Insert: Allows for only Insert operations.
- Update and Delete: These writer modes can be overwritten at the feature type level.
In Update and Delete mode, this feature type parameter takes precedence over the writer parameter Writer Mode. The Writer Parameter defaults to Insert, and the feature type parameter defaults to Inherit from Writer.
Writer Mode Selection
The writer mode can be specified at three unique levels. It may be specified on the writer level, on the feature type, or on individual features.
At the writer level, the writer mode is specified by the Writer Mode parameter. This parameter can be superseded by the feature type writer mode specification. For more information on this parameter, see the chapter Database Writer Mode.
At the feature type level, the writer mode is specified by the Writer Mode feature type parameter. This parameters supersedes the Writer Mode write parameter. Unless this parameter is set to Insert, it may be superseded on individual features by the fme_db_operation attribute.
At the feature level, the writer mode is specified by the fme_db_operation attribute. Unless the parameter at the feature type level is set to Insert, the writer mode specified by this attribute always supersedes all other values. Accepted values for the fme_db_operation attribute are Insert, Update or Delete.
fme_db_transaction
As each feature is processed by the writer, it is checked for an attribute called fme_db_transaction
.
The value of this attribute specifies whether the writer should commit or rollback the current transaction. The value of the attribute can be one of:
- Commit Before
- Commit After
- Rollback After
- Ignore
If the fme_db_transaction
attribute is not set in any features, the entire write operation occurs in a single transaction.
Note: To use this capability, the Transaction Interval (for ArcSDE, this is called Features Per Transaction) must be set to VARIABLE
.