Question

Insert Truncate Existing Option

  • 3 January 2024
  • 4 replies
  • 94 views

Badge +3

Hi everyone,

 

Happy new year :) I have created a series of FME scripts that translate DWG file to a feature class in a FGDB.

I want to ensure that any time the DWG source file is updated, that the feature class is updated accordingly.

Would the "Insert" and "Truncate Existing" option in the Writer be the correct option to choose here? Essentially the user would be updating / adding/ removing polygons from the layer in the source DWG file and I want to ensure that the feature class in the FGDB is also updated.

imageIn this case the feature class in the FGDB already has been created and exists currently.

 

Thanks so much in advance!


4 replies

Badge

create an attribute with with your requirement like "updating / adding/ removing " before the writer and pass this in the parameter and should be given in FEATURE OPERATION in the palette you were showing.

Userlevel 3
Badge +26

The Feature Operation parameter will have an option for fme_db_operation. This means it will be look for an attribute on incoming features named fme_db_operation. Within your workspace create this attribute with values of either INSERT, UPDATE, or DELETE, which will be honored by the writer.

Badge +3

Thanks both @srinivasgg​  and @dustin​ for the response.

Would I be able to create the new attributes all in one transformer such as the below (each named fme_db_operation with a different attribute value of INSERT, UPDATE, DELETE or would that be separate transformers for each , named something else?)

imageAlso with my writer, if I select the fme_db_operation option, would I then still be choosing truncate existing in the table handling, saying yes to spatial handling and then matchign the columns to the same fme_db_operation attribute?

imageI'd just want to ensure that all 3 (any updates/inserts/deletions) from the source are written or updating the feature class in the file geodatabase in the writer.

 

Thanks so much

Userlevel 5
Badge +29

Have a look at the ChangeDetector transformer. This will automaticall categorise features as deleted/inserted/updated/unchanged and set the fme_db_operation attribute to the correct value.

 

In your most recent reply, you'd have table handling as use existing, update spatial as yes and the match column as the object id

Reply