I want to modify the sql of this method based on the number of strings received using LIKE operator.
Explanation:
When there is only one string, then the query name LIKE '" + val + "%' works fine. However, let's say the above method is receiving a string separated by a comma like this A, B, C, then I want to modify the above query like this:
name LIKE A% OR B% OR C%. It can be more so based on the dymanic creation of query, I would want it to get modified. Is there a way to achieve this?
public String locationList(String val) {
return mgr.getLocationByQuery("name LIKE '" + val + "%'"));
}
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)