Select Query always runs into RuntimeException

257 views Asked by At

I always run into RuntimeException when i invoke following query:

val app = from(appTable)(app => where (app.id === application_ID)
      select(app)).single

This query always throws a RuntimeException:

java.lang.RuntimeException: next called with no rows available

What is wrong with my query?

1

There are 1 answers

3
Sergii Lagutin On BEST ANSWER

single means that you expect one and only one result of query. If resultset is empty you receive this exception. Use headOption method instead of single.