hi all,
i have a string getting from variable in my controller like this :
String Vstr = pageContext.getParameter("Myfield");
now i want to use this variable in sql statement but if i pass this variable like +Vstr in my sql statement will throw error : invalid number.
so what i need to do is put ‘ single quotes around this variable value to use correctly in my query like
SELECT column1 FROM table WHERE column2 = 'Vstr';
wait help
hello beter,
basically if you want to add single code to any string you can use :
and if you want to use it inside sql statement hence you are building VO at run time (onthefly :)) so you can write :
where Vstr is your String variable in your example.
hope this helpful 🙂
share today to gain tomorrow.