How To

Incremental Database Updates using the FME format attribute fme_db_operation

Article Number: 000001612 -  Last Modified: Jul 17, 2013

One of the ways to update features in a database is by using the FME Format Attribute fme_db_operation. These example workspaces show how to set-up FME to do incremental updates (insert, update or delete).

One of the ways to update features in a database is by using the FME format attribute fme_db_operation. The attached workbench (fme_db_operation.fmwt) illustrates the use of this to update or delete features from a database.

The steps involved are:

- test the incoming features for a value which will determine whether the feature is an update, delete or insert

- add the attribute fme_db_operation to the features and assign it a value - either UPDATE/DELETE/INSERT

- set the UPDATE KEY COLUMN to an attribute that will match the input features to the database features - in this case it is the attribute "ID". For writers that do not have the Update Key Field use the fme_where format attribute

- change the WRITER MODE on the destination dataset to UPDATE (this causes the writer to recognize the fme_db_operation attribute)

The FME Format Attribute, fme_db_operation, is available on most of the database readers and writers. See the FME User Documentation

The second sample workspace focuses on the use of writer mode on the feature itself - see DataBaseWriterMode.fmwt.

Suggested Similar Articles

The Smallworld FME Translator 4.2.2 and higher supports incremental updates to the Smallworld VMDS. It utilizes the fme_db_operation attribute to specify the type of update - INSERT, UPDATE or DELETE

This example shows how to build an xfMap to read complex XML or GML.

Example custom transformer which sets up the format attributes prior to using a database writer in UPDATE mode to update feature attributes only.

The Database writer is set to UPDATE mode, the fme_db_operation attribute may or may not be set, and a field has been identified as the key to finding the features to be updated but it doesn't appear to be doing the UPDATEs or DELETEs.

This article details a simple method to store complex CAD symbology in a database format. This can be useful if you need to round trip from CAD to GIS back to CAD and preserve the precise characteristics of text (annotation) and symbology.