As long as the shapefile and SDE have the same schema, you can simply connect the two streams to the same writer to append the data (if order is important you can connect both to a Sorter before the writer). Since you want to remove all existing records, you can use the Truncate Existing table handling in the writer parameters
Worth noting, since you want to append the shapefile to an existing table, you could also just inset the shapefile data into the existing table instead of truncating (unless you are updating the existing features at the same time). Take a look at the Combining Multiple Streams of Data (Append vs. Merge or Join) article as it helps to highlight this transformation.
In terms of managing the schema, you could do this with a number of transformers, like the SchemaMapper for example, but my go to is the AttributeManager.
As long as the shapefile and SDE have the same schema, you can simply connect the two streams to the same writer to append the data (if order is important you can connect both to a Sorter before the writer). Since you want to remove all existing records, you can use the Truncate Existing table handling in the writer parameters
Worth noting, since you want to append the shapefile to an existing table, you could also just inset the shapefile data into the existing table instead of truncating (unless you are updating the existing features at the same time). Take a look at the Combining Multiple Streams of Data (Append vs. Merge or Join) article as it helps to highlight this transformation.
In terms of managing the schema, you could do this with a number of transformers, like the SchemaMapper for example, but my go to is the AttributeManager.
This technique works great as long as there is something to write. I am working on a process that reads input, creates some spatial data and writes to an SDE feature class. The problem I'm having is if there is nothing in the input file (which is a valid occurrence) then the feature class isn't touched and is left with whatever data it had in it already; what I need to have happen is to have the feature class end up with nothing in it when the input file is empty. How can this be done?
Thanks for your help.
This technique works great as long as there is something to write. I am working on a process that reads input, creates some spatial data and writes to an SDE feature class. The problem I'm having is if there is nothing in the input file (which is a valid occurrence) then the feature class isn't touched and is left with whatever data it had in it already; what I need to have happen is to have the feature class end up with nothing in it when the input file is empty. How can this be done?
Thanks for your help.
You can truncate the SDE feature class with SQLExecutor.
Or you can try NoFeaturesTester (FME Hub).
This technique works great as long as there is something to write. I am working on a process that reads input, creates some spatial data and writes to an SDE feature class. The problem I'm having is if there is nothing in the input file (which is a valid occurrence) then the feature class isn't touched and is left with whatever data it had in it already; what I need to have happen is to have the feature class end up with nothing in it when the input file is empty. How can this be done?
Thanks for your help.
I cannot get SQLExecutor to use my SDE's connection file. Is there a trick to doing it?