I am trying to ingest several tables incrementally in a pipeline on Azure Synapse using a ForEach Activity.
I have defined a variable as an array of strings. Each string corresponds to the name of a table that I want to query inside the ForEach and copy data from it.
My basic problem is how to pass as the table name at a SELECT query at the source of the Copy Activity, the @item that iterates in the ForEach.
*My connection to the MySQL database is established via ODBC.
2
Answers
Let’s say you have two tables named as dimcustomer,dimpersondetail.
2.you can use the command @concat(‘select * from ‘,item()) in the source query.
Please refer to the screenshots attached.
In the copy activity which is inside the for-each activity, instead of giving query as
select * from @item()
, giveselect * from {@item()}
.I tried to repro this in my environment. Below are the steps.
@variables('list')
is givenselect * from @{item()} where datet > '@{activity('Lookup1').output.firstRow. datet}