Dynamic create parameters depend on input parameters

Sep 26, 2010 at 3:33 PM

Hi sbollaerts

First, thanks for your useful program!

I have question about dynamic create parameters depend on input parameters. I.e, create a list of parameters of a Oracle stored procedure (name of Oracle stored procedure is input as a parameters)

Thanks.

Coordinator
Sep 27, 2010 at 2:12 PM

Hello,

I'm trying to figure out what you are trying to do:

  • If you have only one task: all parameters are described in a declarative way. In this case, it is not possible to determine dynamically new parameters unless you create a static parameter "Values" and the content is comma-separated (or anything that can be parsed)
    • Why not passing directly the parameters this way "@parm1='Value1', @parm2=23" then you simply need to make a call lookling like string.format("EXEC {0} {1}", MyProcName, MyParameters) that results in "EXEC MyProcName @parm1='Value1', @parm2=23"
  • You have 2 tasks: the first task is responsible for determining the stored procedure to be launched and the second (or one task per stored procedure or group of SPs) is responsible for launching the procedure.
    • In this case, you can use chained tasks (function ChainTask(...) which accepts a string dictionnary representing dynamic parameters to be passed)

I think your problem will be solved with the first alternative:

  • A task with 2 static parameters
    • Parm 1 is the procedure name
    • Parm 2 is the procedure arguments string formatted instead of passing a list of KeyValuePair

Hope this helps

Serge

Sep 28, 2010 at 3:06 PM
Edited Sep 28, 2010 at 3:32 PM

Hi Sbollalerts

Thanks for your reply. I have done this by second way and I work fine but I wonder if I could add a procedure before call InitializeParameterList so I can create a dialog to input something before int parameters?

I have some instance of Autorun server using the same DB and I see that it run all task in DB. So I think we could add foreign ServerID to  tlbTask, is it right? Do you have a solution for this issue?

thangtx

Coordinator
Oct 11, 2010 at 6:36 AM

Hello,

I just received another question about using multiple instances of Autorun sharing a same database. I will publish a new release soon in order to do that.

Best regards
Serge