Writer Mode Specification
The Access 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 Update/Delete Key Columns parameter, 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
In UPDATE and DELETE mode, the fme_where attribute always takes precedence over theUpdate/Delete Key Columns parameter. If both the fme_where attribute and the Update/Delete Key Columns parameter are not present, then UPDATE or DELETE mode will generate an error.
When the fme_where attribute is present, it is used verbatim as the WHERE clause on the generated UPDATE or DELETE command. For example, if fme_where were set to ‘id<5’, then all database records with field ID less than 5 will be affected by the command.
When the fme_where attribute is not present, the writer looks for the Update/Delete Key Columns parameter and uses it to determine which records should be affected by the command.
Please refer to Microsoft Access Writer Feature Type Parameters for more information about the Update/Delete Key Columns parameter.
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 writer parameter. This parameter can be superseded by the feature type writer mode parameter. For more information, 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 writer 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.