Benazir Sh
Benazir Sh

Reputation: 91

How to pass a parameter from method in DAO to SQL query?

@Query("SELECT DISTINCT number FROM ${DBTables.SAVED_INPUTS} WHERE number LIKE ':input%'")
fun getSavedInputs(input : String) : List<SavedInput>

This is not working though... I want to pass in that input from method to my query

Upvotes: 1

Views: 331

Answers (1)

Benazir Sh
Benazir Sh

Reputation: 91

@Query("SELECT DISTINCT number FROM ${DBTables.SAVED_INPUTS} WHERE number LIKE :input%")

fun getSavedInputs(input : String) : List

Turned out to be this

Upvotes: 1

Related Questions