# How to use variables in an update table join expression?

**URL:** <https://matillioncommunity.discourse.group/t/how-to-use-variables-in-an-update-table-join-expression/1899>\
**Category:** Matillion ETL\
**Created:** [October 4, 2022, 9:29am UTC](https://matillioncommunity.discourse.group/t/how-to-use-variables-in-an-update-table-join-expression/1899 "2022-10-04T09:29:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAMI](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@RAMI](https://matillioncommunity.discourse.group/u/RAMI)\
**Post date:** [October 4, 2022, 9:29am UTC](https://matillioncommunity.discourse.group/t/how-to-use-variables-in-an-update-table-join-expression/1899/1 "2022-10-04T09:29:55Z")

</div>

Hi,

&nbsp;

using the **Table Update** I'm trying to loop through multiple target tables and update the corersponding input tables based on different columns depending on the specific table being looped through.

&nbsp;

I've added a column for the grid variable called updateTableJoin, which holds the value of the the tables unique column names (e.g. "no\_"). which becomes the variable ${EQM\_raw\_updateTableJoin} (seen in screenshot).

&nbsp;

When i write the **join expression** in the **Table Update** component:

"target".${EQM\_raw\_updateTableJoin} = "input".${EQM\_raw\_updateTableJoin} and run the job. I get an error saying:

_"SQL compilation error: syntax error line 86 at position 56 unexpected '$'."_

&nbsp;

Which leaves me with the impression that the component cannot read variables in the join input?

&nbsp;

Does anyone know how to use a variable in the join section of update table?

&nbsp;

Thanks

Anne

&nbsp;

_(I've also tried writing the full statement in the variable)_
