0

I’m working in Azure Data Factory. I have a Lookup activity that gets a list of authors from a SQL table. Then, in a ForEach loop, I want to run a Copy activity for each author to fetch only that author’s records from the database.

I tried writing the SQL query in Copy activity like: SELECT * FROM table WHERE author = item().author but I got an error saying “item is not a recognized function”, because SQL doesn’t understand what item() is.

example---author='[email protected]'

My question is: ➤ How can I filter the Copy activity’s query for each author from the ForEach loop?

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Jul 10 at 8:36

1 Answer 1

0

Use Concat option :

@concat('SELECT * FROM table WHERE author ="', item().author,'"')

Assuming you dont need quotes within the values

Sign up to request clarification or add additional context in comments.

2 Comments

author value is a string value which contains email id so it requires quotes in the sql query
updated the answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.