Skip to main content
Question

SQL to run after Write (dynamic writer) using fme_feature_type as dynamic (table name).

  • May 27, 2022
  • 2 replies
  • 156 views

so_much_more
Supporter
Forum|alt.badge.img+6

After the dynamic writer is done i need to update some column for each feature type being written.

Something along the lines with (its not the actual SQL, this one is simplified for demonstration )

   
update public.$(feature_type_name) -- This is table name
set area = ST_area(geom)

I want that to be run as 

   
update public.park
set area = ST_area(geom)

But fme_feature_type is not available. Can i do this without hardcoding the feature types names?

2 replies

panda
Enthusiast
Forum|alt.badge.img+20
  • Enthusiast
  • 79 replies
  • May 27, 2022

In Feature Writer > Output Ports I think you can choose Specified: (@Value(fme_feature_type) and that would allow the fme_feature_type to come out the port after dynamic writer. I hope I understand your questions correctly!

 

fme_feature_type


so_much_more
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 46 replies
  • May 30, 2022

Yes good point, that could work. One thing I would like to do is do create/update spatial index after writing to the database. Using a duplicate filter afterward to run a single transaction on the feature type (instead of one transaction per feature).