Passing Array Parameter in Look Activity

Rohit Kulkarni 441 Reputation points
2021-03-11T19:57:20.71+00:00

Hello Team,

I want to Pass the array parameter in lookup activity.

76951-image.png

I am Passing the parameter :

AND LEFT(t.TABLE_NAME,CHARINDEX('$',t.TABLE_NAME) - 1) IN [@{pipeline().parameters.Companies}]

After running the query i am getting error

76838-image.png

Please advise .

Thanks
RK

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

Answer accepted by question author
  1. Nandan Hegde 36,716 Reputation points MVP Volunteer Moderator
    2021-03-12T04:11:55.853+00:00

    Hey Rohit,
    Based on above things I guess your requirement is you want to get the result from Information_schema:
    So please make the below changes :
    Update the Parameter type to String and its value as :
    'Group','ABC'
    without any parenthesis

    And also update lookup activity as below:
    select * from from INFORMATION_SCHEMA.TABLES t

    where LEFT(t.TABLE_NAME,CHARINDEX('$',t.TABLE_NAME) - 1) IN (@{pipeline().parameters.Array})

    Hope that should solve


8 additional answers

Sort by: Most helpful
  1. Rohit Kulkarni 441 Reputation points
    2021-03-11T20:38:58.723+00:00

    And even tried
    @{pipeline().parameters.Companies}

    76894-image.png

    0 comments No comments

  2. Nandan Hegde 36,716 Reputation points MVP Volunteer Moderator
    2021-03-12T12:06:08.317+00:00

    this is the correct one:

    @markus.bohland@hotmail.de ('select * from INFORMATION_SCHEMA.TABLES t
    where LEFT(t.TABLE_NAME,CHARINDEX(','''$''',',t.TABLE_NAME) - 1) IN (', replace(replace(replace(replace(string(pipeline().parameters.Companies),'[',''),']',''),'\',''),'"','''') ,')')

    don't use @ within another @

    0 comments No comments

  3. Rohit Kulkarni 441 Reputation points
    2021-03-12T12:18:12.11+00:00

    Please refer the screenshot for error :

    77108-image.png


  4. Rohit Kulkarni 441 Reputation points
    2021-03-12T12:59:44.613+00:00

    Sorry again i am getting error.I am not able to find exactly the where is missing comma the error is :

    77235-image.png


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.