scalikejdbc build in preventing SQL injection, so when you type like '%$tableName.toLowerCase%'it displays as like '%'urValue'%', so an error occurs.
I found a way to figure out what
def search(name:String){
val searchName = s"%$name%"
DB readOnly{ implicit session =>
sql"select * from db where name like $searchName".map
...
...
}
I hope this can help you.
source
share