Forum Stats

  • 3,839,723 Users
  • 2,262,530 Discussions
  • 7,901,048 Comments

Discussions

Send package variable using batch script in ODI

Las071214
Las071214 Member Posts: 69
edited Sep 28, 2016 6:17AM in Data Integrator

Hi,

We have a package where we have a variable 'period' which we change every month in batch file( like May-16,Jun-16 etc)

While generating/regenerating the scenario , we have checked this variable.

We use a batch script to run the scenario where we pass the variable through batch as below :

startscen.bat EXEC__PACKAGE_VER 001 PROD     "-KEYWORDS=abc"      "PROJECT1.PERIOD=Jun-16"

1. Scenario runs fine only if we update the period variable in package manually.

2. Scenario is getting failed if we remove the variable value in package and pass through variable only through batch (with error : ODI-17506: Variable has no value)

3. ODI is taking package variable value if the variable value given in package and batch are different.

Could any one suggest how can i pass variable value into scenario through batch.

Thank You!

Regards

Sowjanya Rayala

Tagged:

Answers

  • rpc1
    rpc1 Member Posts: 1,503
    edited Sep 26, 2016 11:59AM

    Did you declare your variable before using in package? if you want to pass variable value through scenario

    you have to declare it first

    pastedImage_0.png

    Las071214
  • Las071214
    Las071214 Member Posts: 69
    edited Sep 26, 2016 11:06PM

    Hi @rpc1

    Thank you very much for the quick reply with screenshots.

    I just checked my package and the variable is declared.

    Are there any other options or parameters i have look at ?

    Thanks again!

    Regards

    Sowjanya Rayala

  • rpc1
    rpc1 Member Posts: 1,503
    edited Sep 27, 2016 2:19AM

    I little confused,  you don't need extra parameters,

    look at example, I pass variable and throw it in exception

    pastedImage_0.png

    Please make sure that in odiparams you use right work repository

  • Las071214
    Las071214 Member Posts: 69
    edited Sep 27, 2016 2:49AM

    Hi,

    I just wanted mask the original keyword and hence gave abc.

    We have a different keyword in our package and we never get this error.

    Thanks !

    Regards

    Sowjanya Rayala

  • Las071214
    Las071214 Member Posts: 69
    edited Sep 27, 2016 7:22AM

    Hi,

    Can any one please suggest on this.

    We have a variable in package (Declare Variable). We are trying to pass the varaiable value through batch.

    But package is not taking batch variable. It is taking the Default Value given to the variable. If Default Value is left blank, package load is failing with below error.

    ODI-17506: Variable has no value

    Thank You!

  • ASP_007
    ASP_007 Member Posts: 333
    edited Sep 27, 2016 8:41AM

    Hi Sowjanya

    Look at this post talks about similiar issue. Hope thats is useful

    Variable has no value when executing a scenario

    Regards

    ASP

    Las071214
  • rpc1
    rpc1 Member Posts: 1,503
    edited Sep 27, 2016 2:16PM

    This is only example, that variables works fine in startscen utility.

    Could you show variable definition. I can't understand what is wrong. You have to check all twice you package, recompile your scenario,

    may be you have mistake in passing variable? For example you have similar variables in different projects......

    Does your package belongs to PROJECT1?

  • Las071214
    Las071214 Member Posts: 69
    edited Sep 28, 2016 4:29AM

    Hi @rpc1

    Thank you for the inputs

    I have created a new variable (declare variable)  and inserted in the package flow.

    I still face the same error.

    Do I have to give any query in Refreshing tab for the variable.

    Please suggest. Thank You!

    Regards

    Sowjanya Rayala

    Las071214
  • rpc1
    rpc1 Member Posts: 1,503
    edited Sep 28, 2016 6:17AM

    No you don't need to fill refresh query because you don't use this variable as refresh.

    You pass values  only... What is ODI version do you have?

    try to create new package with you variable and generate scenario then try to start it

This discussion has been closed.