You are here: FME Readers and Writers > Microsoft Excel (XLSXR/XLSXW2) Reader/Writer > Writer > Writer Mode Specification

Writer Mode Specification

The MS Excel writer allows the user to specify a writer mode, which determines the operation to perform for each feature received. Valid writer modes areare Insert, Update, and Delete.

Writer Modes

In Insert mode, the attribute values of each received feature are written at the next row in the sheet, overwriting any data that might exist at that location.

In Update mode, the attribute values of each received feature are used to update existing rows in the worksheet. The rows that are updated are determined via the xlsx_row_id_column DEF line parameter.

In Delete mode, the attribute values of each received feature are used to remove cell values and formatting corresponding to the amount of attributes in the schema. The rows that are changed are determined via the xlsx_row_id_column DEF line parameter.

Writer Mode Constraints

In UPDATE and DELETE modes, the writer looks for the xlsx_row_id_column DEF line parameter and uses it to determine which records should be affected by the command. Please refer to the DEF section for more information about the xlsx_row_id_column DEF line parameter.

In INSERT mode, the writer still looks for the xlsx_row_id_column DEF line parameter and will use it if it exists, but it is not a required attribute.

Writer Mode Selection

The writer mode can be specified at two unique levels: on the feature type, or on individual features.

At the writer level, the writer mode specified by the WRITER_MODE directive is inherited as the starting writing mode by all of its feature types.

At the feature type level, the writer mode is specified by the xlsx_writer_mode DEF line parameter. It may be superseded on individual features by the fme_db_operation attribute. Please refer to the DEF line documentation for more information about this parameter.

At the feature level, the writer mode is specified by the fme_db_operation attribute. The writer mode specified by this attribute always supersedes all other values. Accepted values for the fme_db_operation attribute are INSERT, UPDATE and DELETE.