Pass in user input to sql query execute query

studio

#1

I am new to UIPath and have tried all the answers that I found using google search. I need to take user input and append it to sql execute query as like. e.g. select wellname from tbl1 where wellname like ‘%userinput%’.
I tried “select wellname from tbl1 where wellname like '%” + wellname + “’” and “select wellname from tbl1 where wellname like '%” & wellname & “’” and “select wellname from tbl1 where wellname =@wellname” nothing works.

please help


#2

@shanugoel,“select id from tbl1 where Source_id=@Source_ID_p”

Did you invoke the arguements and assigned it correctly.This query works for me

Thanks,
Sreekanth.k


#3

Thanks. That worked. I had tried the parameter before but I did not setup correctly.


#4

If i need to change this to a like statement then how will you code the select? I have tried “select id from tbl1 where Source_id like ‘" + @Source_ID_p + "%’" and also “select id from tbl1 where Source_id like ‘" & @Source_ID_p & "%’"