Solved

Does the "Before Script" and "After Script" in JDBC writer step support parameterisation?

  • 6 December 2023
  • 2 replies
  • 31 views

Userlevel 3
Badge +2

I have a use case to use the JDBC writer step to write some data into a MS SQL db.

I will need to use the Before and After script feature. (Truncate the table in the before script, then I need to call a stored proc in the after script).

And in the after script, I need to construct that based on some value that I calculate in the plan. So it is different every time I run the plan, but I need to keep it consistent.

Does this after script support some parameterisation? I have a feeling it won’t but wanted to double check.

icon

Best answer by AKislyakov 7 December 2023, 05:42

View original

2 replies

Userlevel 3
Badge +2

If the answer is no then I think I’ll need to wrap this in a .ewf and parameterise it into the Execute SQL task. Just wanted to check that I need to go down this approach?

Userlevel 4
Badge +4

Hi @maykwok_hamilton 

No, before and after scripts are executed only once and thus do not accept any parametrization coming from the plan. What you can do is indeed define before and after scripts as parameters and pass those from the workflow. 

Reply