Search code examples
databasetalend

dynamic action on a table tDBOutput component


My question is :

Is it possible to specify the action(Truncate table / Delete table if not existe ..) on a tDBOutput dynamically with a variable context ?

The purpose of this job is :

  • to register a new mode_exec context variable at the job level to configure the execution mode .
  • mode_exec = INIT (initialization) allowing to make a truncate of a DW table before being loaded by a data file.
  • mode_exec = INCR (incremental) forbidding to make a truncate of a DW table before it is loaded by a data file.

Any explication plz


Solution

  • No you won't be able to do this kind of operations in a tDBOutput. But you can set up a tDBRow with instruction "Truncate TABLE XX" at the beginning of your job. Then you condition the execution of this tDBRow component with your variable, in an "IF" link" :

    enter image description here

    In the IF link you'll have the condition "INIT".equals(context.mode_exec)

    This should work, let me know.