2 Replies Latest reply: Sep 28, 2012 12:44 AM by Javed C RSS

    How to use a Global variable declared in ODI in a package and a procedure

    Javed C
      Hi,

      I am using ODI 10g.

      I have created a package which contains some procedures.In one of the procedure there is an insert statement.
      The values earlier inserted using this procedure was cosntant so there was no problem, but now I want to insert a value which i m getting from a variable declared as global in the package.

      I created a new global variable , provided the query and all.After that I regenerated the procedure.

      Now as per my understanding
      1.That variable should come in the variable list of package.
      2.The procedure should use this variable and insert the values as per the variable.

      But neither i am getting the variable in package as well the procedure is not inserting the variable value.

      Please let me know if there are any steps i m forgotten or some other way to implent this.

      Thanks is advance.

      Regards,
      Javed.
        • 1. Re: How to use a Global variable declared in ODI in a package and a procedure
          Sutirtha Roy
          Javed C wrote:
          Hi,

          I am using ODI 10g.
          For ODI related query it is better to post it in ODI forum
          Data Integrator
          I have created a package which contains some procedures.In one of the procedure there is an insert statement.
          The values earlier inserted using this procedure was cosntant so there was no problem, but now I want to insert a value which i m getting from a variable declared as global in the package.

          I created a new global variable , provided the query and all.After that I regenerated the procedure.
          Regenerated procedure means ? Did you re-write the procedure code or Regenerated scenario of it ?
          Now as per my understanding
          1.That variable should come in the variable list of package.
          No .. Global variable does not show unter any package/project tree . It is visible in Other tab -->Global variables
          2.The procedure should use this variable and insert the values as per the variable.

          But neither i am getting the variable in package as well the procedure is not inserting the variable value.
          How/what have you written in the procedure code to get the global variable's value ?
          Please let me know if there are any steps i m forgotten or some other way to implent this.

          Thanks is advance.

          Regards,
          Javed.
          • 2. Re: How to use a Global variable declared in ODI in a package and a procedure
            Javed C
            Hi ,

            Apologies for creating the post here.

            Regarding your comments:

            Regenerated procedure means ? Did you re-write the procedure code or Regenerated scenario of it ?*

            Yes I have regenerated the scenario only.

            No .. Global variable does not show under any package/project tree . It is visible in Other tab -->Global variables*

            Yes, you are right that global variables will be displayed under Others tab, but if i am checking the package variables i.e. what all variable that package is using than I am able to see other global/local variables under it.

            Now, my question is what i need to do to see my new variable under the package.


            How/what have you written in the procedure code to get the global variable's value ?*

            The code wriiten in the procedure is :

            suppose my variable name is "var_scenario"

            begin

            insert into <table_name> (column 1, column 2)
            values('Test',#var_scenario);

            End;


            I tried

            begin

            insert into <table_name> (column 1, column 2)
            values('Test',#GLOBAL.var_scenario);

            End;

            also but of now use.

            Please advise, i m stucked in it.

            Regards,
            Javed