Ben
Ben

Reputation: 81

ADF Azure Data-Factory Concating syntax

i'm trying to run a pipeline that results the names of specific Databases (@item().USERNAME) with the same table name - Stores . I created a pipeline with lookup and for each that works fine . however when I want to filter the tables to only the coulmns I want ( within the for each copy data activity ) - I cant find the right syntax

i tried - @concat ( select CODE_NO,CITY,STREET from @item().USERNAME.STORES) but i'm getting errors

Anyone can help me fix this ? thanks in advance !

Upvotes: 1

Views: 1241

Answers (2)

Himanshu Kumar Sinha
Himanshu Kumar Sinha

Reputation: 1786

If the intend is to have a SQL query like

SELECT CODE_NO,CITY,STREET FROM someDbName.Store I think we can use

@concat('SELECT CODE_NO, CITY, STREET FROM  ', item().USERNAME,'.STORES')

Upvotes: 1

Godwin
Godwin

Reputation: 54

That second @ symbol is not needed when using a nested function in ADF.

Try

@concat('SELECT CODE_NO, CITY, STREET FROM ', item().USERNAME.STORES)

Or

@concat('SELECT CODE_NO, CITY, STREET FROM ', string(item().USERNAME.STORES))

The second one may not be necessary, depending on your confidence in the data types being passed into the ForEach.

Upvotes: 1

Related Questions