Use variables in SQL querie

i try to use my variable strInputEmail in my SQL query.

UiPath told me now that i have a syntax error and I dont know why…

My query is
“Select UserID From User WHERE Mail = @strInputEmail

Every column is correct and the variable name also…

What is the correct syntax to user variables in my queries?

Thanks for your help:-)

1 Like

Use “+” to use variable in a string say
"My name is "+Var_Name
For strInputEmail this var
“Select UserID From User WHERE Mail = "+strInputEmail


You can pass the variable by using parameters

Hope this helps


Hi @Ashtari

“select * from User”

“select UserID from User WHERE Mail = '”+strInputEmail+“'”

Hope this would solve your issue :slight_smile:
Mark as solution and like it.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

hi @Pratik_Wavhal
I would like to execute the below query
“select distinct a.* from dbo.Required_Skills a left join dbo.Employee_Skills_Details b on a.[Display Expression] = b.[Training Role]
where b.FirstName ='”+fName+“’ or b.LastName ='”+lName+“'”
But getting error. please help on this