question

arkiboys avatar image
0 Votes"
arkiboys asked ShaikMaheer-MSFT commented

data factory lookup - dynamic content error

Hello,
The error I get is --> incorrect syntax near the keyword is

note that in my parameter EntityName, I should be able to either leave it blank or add a value
do you see the issue please?

select * from edp.LoadTables where SchemaName = '@{pipeline().parameters.pSchemaName}' and SourceSystem = '@{pipeline().parameters.pSourceSystem}' and (@{pipeline().parameters.pEntityName} is null OR EntityName = '@{pipeline().parameters.pEntityName}')

in sql it is like the following and it works fine whether you pass in @EntityName or not

declare @EntityName varchar(50) = 'vw_Department'
select * from edp.LoadTables
where SchemaName = 'eol' and SourceSystem = 'xyz'
and (@EntityName is null OR EntityName = @EntityName)

azure-data-factory
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @arkiboys ,

Thank you for posting query on Microsoft Q&A Platform.

Following up to see if below provided answer helps you? If yes, Please accept answer by clicking 130616-image.png button. Please feel free to let us know if any follow-up queries. Thank you.

0 Votes 0 ·

Hi @arkiboys ,

Just checking to see is below answer helps you? If yes, Please consider Accept Answer. Accepted answers helps community as well. Thank you.

0 Votes 0 ·

1 Answer

NandanHegde-7720 avatar image
0 Votes"
NandanHegde-7720 answered

Hey,
you can use a combination of equals and coalesce to handle that scenario something like below:


 @equals(coalesce(pipeline().parameters.Test,'0'),'0')

for this scenario : @{pipeline().parameters.pEntityName} is null

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.