2 Replies Latest reply on Feb 27, 2014 12:07 AM by FPonte

    Significance to Declare Variable



      When is a Declare variable required in a package and what purpose does it serve




        • 1. Re: Significance to Declare Variable



          You DECLARE a variable when you want to set its initial value when calling the Package.


          If the value of your variable is fixed you can just SET (Assign) its value.


          If the value is based in a query you can just REFRESH its value.


          You also can use a variable in a CONDITIONAL or INCREMENTAL way inside your package.


          More info here.




          1 person found this helpful
          • 2. Re: Significance to Declare Variable





            If you use a variable in an Interface and you use the interface scenario in a Load Plan. You will need to specify the variable initial value if you choose to declare it.


            Example 1:

            Lets say that you have a Package and you control the execution of some steps of this package with a Flag Variable. "E" for execute the steps and "N" to not execute. On each execution of the package you can tell, by declaring the initial value in the load plan, that you want or not execute those steps. Those steps can be to log data, generate some file output, etc...


            Example 2: You may have different interface scenario version in your package. You can start the package saying that you want to execute the Version 1 or 2 by declaring and setting the variable inital value.


            Example 3: You may use a variable in a package to store the PATH where your Error logs are stored.

            Dev: VarLogPath = \\dev_server\shared_logs\odi_log

            Test: VarLogPath = \\tst_server\shared_logs\odi_log

            Prod: VarLogPath = \\prd_server\shared_logs\odi_log

            You have the flexibility to change the path location to wherever you want