Truncate table before loading?

How can I truncate a table before loading?

I’ve tried the following:

  1. add a truncate table statement to DBOutputTable followed by an insert
  2. add a delete statement to DBOutputTable followed by an insert

I also don’t see anything in the component property to perform this operation.

For some context, I like to load my data into an empty staging table before loading into the target with an insert or upsert. Now that I think of it, I’m not sure I can do this in Clover.

Any guidance?

Thanks.

Hello CiscoChi,
for “static” statements, like truncate table or create table, you should use DBExecute component. Create graph, which in the first phase truncates your database table and in the next phases does the rest of your transformation (see example extExamples/graph/graphDBLoad5.grf from our examples: cloverETL.examples.rel-2-8-0.zip)

Thanks!

I found DBExecute after I posted. This works for me.