1 Reply Latest reply: Dec 2, 2014 6:08 PM by Kenneth Madsen RSS

    Using NamedParameters in Expressor

    Will Hancock

      I'm using Expressor 3.12 and having an issue with the NamedParameters.  I have established in the configuration as a parameter.  And for all appearance, seems to be writing the value when writing the parameter.  However, when I reference the parameter in a filter function in a subsequent step, I get the following:  attempt to index global 'expressor' (a nil value).  I confirmed the syntax of each.


      Setup in Configuration:

      Configuration.jpg

      Assignment in Transformation:

      Configuration.jpg

      Usage in Filter:

      UsageInFilter.jpg

       

      What is strange is that this code is using a similar parameter (Start_Date) coded previously that does not seem to have an issue.  However, if I attempt to reference Start_Date parameter in the filter above, I get the same error.  If Start_Date was not valid and available, it would fail prior to getting to the step that I'm working from now.  In comparison of both parameters, all seems equal.

       

      What am I missing?

        • Re: Using NamedParameters in Expressor
          Kenneth Madsen

          We use Named Parameters for parameterized connections in a Configuration artifact. Our sources and targets are databases.  What I have found is you have to access the connection in order to populate NamedParameters, so we have one dataflow that just has dummy read table operators connected to trash, just to populate NamedParameters.

           

          We also use utility.store_string (and store_integer) and their retrieve counterparts so that one dataflow can set the values and one or more dataflows later can access them.  We have a configuration file that has the name/value pairs that we load with utility.store_string.  In other cases, we use a store function to return some data (usually a max sequence from some logic that counts records processed and then later in the same dataflow or another dataflow, we can do something with that max value.

           

          I am not sure how you are getting the NamedParameter table to load.  I have used this to check in an initialize function whether the table is actually populated:

           

            for k,v in pairs(expressor.NamedParameters) do

              log.information("%s",k..": "..v)

            end

           

          HTH