Parameter Null

Rohit Kulkarni 441 Reputation points
2021-03-23T10:26:08.897+00:00

Hello team,

The pipeline has Comapnies and Tablewith company as a parameter if we pass for whole companies and Tablewithcompany it is taking more than 10 hrs to excute the pipeling so we planned to pass only prmutation and combination like

  1. 1 companies and 1 Tablewithcompany : It is working perfectly
  2. 1 companies and Tablewithcompany is null : it is not working properly .

I am passing the parameter value :

80610-image.png

80609-image.png

I am passing these two parameter
companies :["Group"]
TablesWithCompany :[]

It is not working properly because i have parameterized query where it will fetch like

select * from dbo.Group$[]

I am expecting like to fetch the query :
select * from dbo.Group$Vendor
select * from dbo.Group$GL_Account (It must take all the tablewithcompany data)
The query:

if ISNULL( ('@{ if(lessOrEquals(length(pipeline().parameters.TablesWithCompany),1),
join(pipeline().parameters.TablesWithCompany,''),
concat(join(pipeline().parameters.TablesWithCompany,''','''))
)}'),'')<> ' '
Begin
select DISTINCT RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME)) AS TableName
from INFORMATION_SCHEMA.TABLES t
where t.TABLE_TYPE = 'BASE TABLE'
AND t.TABLE_NAME like '%$%'
AND t.TABLE_NAME not like '%$%$%'
AND t.TABLE_NAME not like '%_Bak'
AND t.TABLE_NAME not like '%_%1%'
AND t.TABLE_NAME not like '%_%2%'
AND RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME))
IN ('@{ if(lessOrEquals(length(pipeline().parameters.TablesWithCompany),1),
join(pipeline().parameters.TablesWithCompany,''),
concat(join(pipeline().parameters.TablesWithCompany,''','''))
)}')
End
ELSE
Begin
select DISTINCT RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME)) AS TableName
from INFORMATION_SCHEMA.TABLES t
where t.TABLE_TYPE = 'BASE TABLE'
AND t.TABLE_NAME like '%$%'
AND t.TABLE_NAME not like '%$%$%'
AND t.TABLE_NAME not like '%_Bak'
AND t.TABLE_NAME not like '%_%1%'
AND t.TABLE_NAME not like '%_%2%'
AND LEFT(t.TABLE_NAME,CHARINDEX('$',t.TABLE_NAME) - 1) <> ''
END
--AND RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME)) IN ('Value Entry')

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

1 answer

Sort by: Most helpful
  1. Nandan Hegde 36,716 Reputation points MVP Volunteer Moderator
    2021-03-23T11:57:16.467+00:00

    Hey you can try this:
    @hamed1374 (equals(coalesce(<<parameter>>, ' '), ' ')) to validate whether the parameter is null


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.