2. Writing to Databases - Inserts
Easy to INSERT data
Automatically INSERTs new data
Creates a table if it doesn’t exist
Appends to an existing table
Simple settings for:
Drop Table or
Truncate Table
3. Writing to Databases - Updating/Deleting
Updating/Deleting existing data isn’t so easy
Requires multiple parameter settings
Uses format attributes and writer ‘modes’
Might involve multiple transformers
Can take some effort to get working
Prerequisites to incremental updates…
You need to know which features to
insert / update / delete !
4. New Transformers
DatabaseUpdater
Features enter the transformer and it updates
existing features
DatabaseDeleter
Feature(s) enter the transformer and it deletes
existing features.
5. Formats Supported
Google Fusion
Access
SQL Server
Oracle
PostgreSQL/Postgis
SQL Lite
Windows Azure
7. Pros
Very easy to configure
Great for relatively simple updates:
a few feature types
a small number of fields
Great for deleting based on an attribute value
8. Cautions
No Geodatabase support
No Transactioning or Commit/Rollback handling
Not so useful for updating lots of attributes
Not appropriate for Dynamic Workflows
9. Other Approaches
Use feature based updates
fme_db_operation
fme_where
See the KnowledgeBase article:
http://fmepedia.safe.com/articles/How_To/Using-
Feature-Based-Attributes-for-Database-updates
FME database writers it’s straight forward to do database INSERTS1. Inserting.fmw - mapinfo parks to Postgis
It’s more complex to do incremental updates – UPDATE & DELETES. The writer and feature type parameter settings are more complex and are interdependent. MAS: Also, to do incremental updates you need to know which features are the update and the delete features. This isn’t really an FME problem. Some FME readers tell you which features have changed (i.e. Smallworld) In other cases you may have a change history table or file. In other cases you may have to use brute force and the Matcher or ChangeDetector to compare datasets and then flag the INSERT/UPDATE/DELETE features.
New transformers makes updates and deletes for relatively small database configurations2. Updating.fmwtBusStops and routes loaded into Postgis.New Busstop in a shape fileUse DBUpdater to update the new busstop location and ID – look for STOPABBR = NRWBTW3M. Display in Data inspector. After running the update workspace refresh and notice that it jumps back onto the line.3. Deleting.fmwDeletes the parks with the <null> names
Limited format support Currently only formats which support feature based updates (fme_db_operation) are supported which is why Maria DB isn’t in the list.Also Geodatabase is missing because of the version complexity.
2. Updating.fmwtBusStops and routes loaded into Postgis.New Busstop in a shape fileUse DBUpdater to update the new busstop location and ID – look for STOPABBR = NRWBTW3M. Display in Data inspector. After running the update workspace refresh and notice that it jumps back onto the line.3. Deleting.fmwDeletes the parks with the <null> names
Some limitationsDynamic workflows using schemaMapper and dynamic output is not possible.