Datafactory Lookup Activity Error

Axell 66 Reputation points
2021-12-01T08:17:12.277+00:00

Hello, i have some pipeline for create SQL from API, like
CopyData-CopyData-CopyData-CopyData and save it to my DB.
Table for example:
154062-1.jpg
Than in final i add Lookup action with some settings

UPDATE table_name
SET table_name.parameter = 0
WHERE table_name.parameter = 'Nothing'

154010-2.jpg

And have this error:
154063-3.jpg

But, despite the error, the Lookup action performs the necessary operations with the database for me and write it into my DB.
How i can resolve that? May be lookup can't be last operator in pipeline???

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

Accepted answer
  1. Nandan Hegde 29,231 Reputation points MVP
    2021-12-01T08:19:35.503+00:00

    Hey,
    It is expected that something be returned in lookup activity.
    So you can add a query at the end as
    Select '1'

    UPDATE table_name
    SET table_name.parameter = 0
    WHERE table_name.parameter = 'Nothing' ;
    
    Select '1'
    

1 additional answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 37,051 Reputation points Microsoft Employee
    2021-12-01T14:42:48.007+00:00

    Hi @Axell ,

    According to official documentation, Lookup activity reads and returns the content of a configuration file or table. It also returns the result of executing a query or stored procedure.

    This means, your query should always return some results back.

    In your case, you are using Update query which simply update records in DB but nothing returns back to ADF. Hence, you see that error.
    As @Nandan Hegde suggested, we can execute select '1' query at the end of update query to trick this and make sure something is returning to ADF. That in turn avoids error. Thank you.

    1 person found this answer helpful.
    0 comments No comments