Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How to update variables from db values

We use one table as a parameter table, whose values affect subsequent processing. At present, I read the values in a Python script component and update the variables via the context. It works, are there some built-in functions for this, such as the Export tab of a Table Input component? As I see it, the Export tab is only for runtime information.

3 Community Answers

Matillion Agent  

Ian Funnell —

Hi Arto,

Using a Python script is absolutely fine, and you’ll see an example syntax in the comments when you create a new Python Script component:

context.updateVariable('myvar', 'new-value')

The other way is to use the Table Iterator component. You would use this as a loop driver, and it’s great if you want to run the same task(s) multiple times, with one iteration per record in the table. The values of variables are set according to the column values in the table. The iterator’s Column Mapping property allows you to specify which columns go into which variables.

Yes, the export tab is mainly for exporting runtime metadata like rowcounts and durations. It won’t let you export custom variables in the way that the Python and the Table Iterator do.

Best regards,

Pankaj Shrestha —

Ian -

Is there a way to define table columns dynamically as well such that a single job can be used for loading multiple tables with different columns following the same ETL pattern?


Matillion Agent  

Harpreet Singh —

Hi Pankaj

You can use the Grid Variables to pass Arrays and Lists and use it to replace the columns. See the article on how to use the Grid variables


Post Your Community Answer

To add an answer please login