Unable to execute update query in run query activity with parameters

Hello,
I am using run query activity to execute update query while passing dynamic value as parameters but it is throwing error.(Excel as DB)
Query Used:
“Update [Sheet1$]
set [TestResult] = @Argument1
Where [ExpectedResult] =@Argument2”

Getting below error:
“Run query: ERROR [07002] [Microsoft][ODBC Excel Driver] Too few parameters. Expected 2”.

Hi @poonampandire95

Instead of using the parameters to pass the values you can use variables also I tested it works like this

Your query will look like this

“Update [Sheet1$]
set [Second] = ('” + P1 + “‘)
Where [Second] =(’” + P2 + “')”

More like this

“Update [Sheet1$]
set [TestResult] = ('” + P1 + “‘)
Where [ExpectedResult] =(’” + P2 + “')”

Hope this helps :slight_smile:

Hello @AJ_Ask
Now its working.
Thank you for the help :slight_smile: .

If my reply helped. Please accept it as a solution so that it can help others also. :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.