How to apply case sensitive with LIKE query when use room persistence library android??
using below query
@Query("SELECT * FROM category WHERE category_name LIKE '%' || :categoryName|| '%'")
List<Category> getAllCategory(@Nullable String categoryName);
Use PRAGMA case_sensitive_like = on not working
By Help of pskink found answer:
Use GLOB instead of LIKE, Successful Query as below
@Query("SELECT * FROM category WHERE category_name GLOB '*' || :categoryName|| '*'")
List<Category> getAllCategory(@Nullable String categoryName);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With