question

FranciscoDominguez-7929 avatar image
0 Votes"
FranciscoDominguez-7929 asked HitenBhavsar-MSFT commented

Script activity failed: Argument {0} is null or empty. Parameter name: paraKey

Hi,

I'm using the new script activity to perform two select queries in my database. I have set the dynamic content to be like this:


 @concat('SELECT BCode, SUM(Waa) FROM table1 WHERE BCode=3 AND Date=''', variables('currentDate'), ''' GROUP BY BCode ',
    
 'SELECT BCode, SUM(Waa) FROM table1 WHERE BCode=3 AND Date=''', variables('previousDate'), ''' GROUP BY BCode')

However, when debugging the pipeline all I get is the following error:

Error code
2011
Failure type
User configuration issue
Details
Argument {0} is null or empty.
Parameter name: paraKey

However, I have other script activities before this one and none of them is failing. What is wrong?

Thanks in advance.

azure-data-factory
· 4
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.

After some more testing it seems it might be related with the SUM() function, in case it's helpful.

0 Votes 0 ·

Additional info, executing the same query with a Lookup activity works without any problems:

 SELECT BCode, SUM(Waa) FROM table1 WHERE BCode=3 AND Date='2021-07-31T00:00:00' GROUP BY BCode
0 Votes 0 ·
KranthiPakala-MSFT avatar image KranthiPakala-MSFT FranciscoDominguez-7929 ·

Hello @FranciscoDominguez-7929,

Thanks for the question and using MS Q&A platform.

As per my understanding, you are trying to execute a SQL script using Script activity in ADF but you are getting above error message. And as per you analysis you found that it could be related to SUM function used in the SQL script, if you execute the same script in lookup activity it is working fine where as it is failing in Script activity. Please correct me if I'm not clear.


The error message says Argument {0} is null or empty. Parameter name: paraKey Are you using paraKey anywhere in your script? If so could you please complete script with dynamics expressions used in it as well as the script with hardcoded values (no dynamic expressions). From the error message, your parameter paraKey is expecting a valid value for Argument {0} and it complaining that the provided value is null or empty.

Could you please double check if you are passing expected values to your parameter paraKey? It would be helpful for us if you could share your pipeline JSON payload.





0 Votes 0 ·

Please check this QnA.
https://docs.microsoft.com/en-us/answers/questions/776313/script-activity-failed-argument-0-is-null-or-empty-1.html

Missing Column name for sun , ADD SUM(Waa) AS SUMwaa

0 Votes 0 ·

1 Answer

FranciscoDominguez-7929 avatar image
0 Votes"
FranciscoDominguez-7929 answered BradJohnson-4697 published

Hi @KranthiPakala-MSFT,

I do not have paraKey anywhere in my script. I actually changed to another query, different than the ones I posted above, and my error was gone. I will be marking this as solved, but something in my previous queries wasn't right.

Thanks for your help.

· 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.

I discovered the same issue with the empty parakey - for example, if I script: select count(1) from table it fails - if I change it to: select count(1) as my_count from table it works. It doesn't like a return value not having a specific field name.

4 Votes 4 ·

Glad to know that you were unblocked @franciscodominguez-7929. :) and many thanks for sharing your findings.

Please feel free to open a new thread if the issue persists and we will be happy to assist.

Thank you.

0 Votes 0 ·