Skip to main content
Question

How to truncate a table while the writer is empty.


fme_hans
Contributor
Forum|alt.badge.img+5

Hi,

 

I have a workspace that truncates an SDE geometry table and refills it. The workspace runs daily and sometimes there are no records to write. In that case the writer only has to truncate the table. I don't see an option truncate first or anything like that in a sde writer.

How can I truncate a table while the writer is empty?

 

 

6 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • March 31, 2021

For this sort of scenario, I'd truncate the tables using an sqlexecutor upstream of the writers to ensure all tables are truncated.


fme_hans
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • April 1, 2021

Thanks. Now I use a creator followed by a sqlexecuter. This works.


Forum|alt.badge.img
  • March 15, 2022

In my case I'd like to truncate the table (FGDB feature class) that is in the Reader, after the table has been read. Is that possible?


fme_hans
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 28, 2022

I do not know. i never truncated right after the reader. I have to test it.


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • March 28, 2022

An SQLExecutor downstream of the Reader should do the trick.

Note that one SQL query is issued for each feature that enters the transformer. So do make sure only one feature enters the SQLExecutor!

Maybe use a Sampler (sample the last feature!), or the combination of a Creator and a FeatureReader.

Trigger_SQLExecutor


fme_hans
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 29, 2022

Thanks, i will try this.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings