I have an issue with Room which I haven't been able to find help for elsewhere - the usual '%' for matching any number of characters when using 'LIKE' in SQLite doesn't work with the Room delete query we are using in my team's project.
We have a delete query defined as a string in Kotlin, in one of our DAOs:
const val DELETE_BY_RESERVATION_CODE = "DELETE FROM ${TdaRoomDatabase.TABLE_REQUESTS} WHERE uri LIKE :reservationCode"
And a deleteRequest in the same DAO:
@Query(DELETE_BY_RESERVATION_CODE)
fun deleteRequest(reservationCode: String)
However, after adding the percent symbols around the ':reservationCode' parameter reference we get the following error:
No viable alternative at input 'DELETE FROM requests WHERE uri LIKE %'
Is anyone aware of how to use the percent symbol when using 'LIKE' in a Room DB query? My team and I (not well-versed in SQL) expected it to behave like SQLite but this doesn't seem to be the case!