View Sidebar
SQLite Database NoCase Sensitive Search

SQLite Database NoCase Sensitive Search

April 30, 2014 17:20

Working on Search operation in SQLite database can be tricky. The text search operation on SQLite database is by default case sensitive, due to which you can miss out on quite a few results.

To make the search query ignore the cases and work irrespective of any input provided the text column of the SQLite table should be marked with COLLATE NOCASE. The select query on the text fields will work irrespective of the text case.

 

CREATE TABLE EmpTab (
“EmpID INTEGER, ” +
“EmpName TEXT COLLATE NOCASE, ” +
“EmpDesignation TEXT COLLATE NOCASE,);

If you like the article please share

Leave a reply