Skip to main content

Hi! I’m new to FME. I’m trying to replace an existing feature class with data from a SQL query. I got it to work by using a Reader that specifies the existing table, SQLCreator then a Writer. When I add the writer, it’s using the “Copy from reader” option. 

Is there a way to use the FeatureWriter transformer and specify an existing feature class instead of using a Writer?

You can import the existing dataset that you can overwrite, update, etc using “Import from Dataset”

 


If you wish to replace a Feature Class this can be specified in “Table Handling”

The two relevant options are to “Drop and Create”, which will Delete the Feature Class and replace it with a new Feature Class with the Field Definitions defined in the Writer.  “Drop” comes from SQL terminology where DROP is the command used in SQL to mean “Delete”

Otherwise a close equivalent is “Truncate Existing”.  This deletes all the rows, but does not delete the Feature Class.  This is if want to keep/reuse the existing field definitions (and any field indices, domains, subtypes etc. that have been setup) already defined in the Feature Class and just want to overwrite the existing features with new features.  Again TRUNCATE is SQL terminology for “Disable/delete all rows” depending on platform.
 

Note, the same Table Handling Parameters are available in the Writers as well, so you don’t need FeatureWriter to do this.  It can be done in Writers or FeatureWriter.

 

 


Thank you so much! “Import from dataset” worked and I used the “Truncate Existing”.

I appreciate your help!


Reply