Passing variable to insert command sql query

Hi,

I have two variable documentID and EmailPath

i am passing them to insert command as shown below:

“INSERT INTO TTC_RPA.dbo.Submission_Details_Table VALUES (@documentID,’@EmailPath’,GETDATE());”

But i get the error while executing the sqquence

Execute Query: Must declare the scalar variable “@documentID”.

Where and how to declare these variables.

Please help.

Regards,
Heena

Hi,

Pls try below one.
“INSERT INTO TTC_RPA.dbo.Submission_Details_Table VALUES (”+documentID+","+EmailPath+",GETDATE())"

Note:Use ExecuteNonQuery Activity

2 Likes

The same issue, any help ?

Hi @vanhuyit89,

Welcome to Uipath Community :smiley:

Could you please share your query.

Regards,
Omkar P