Register independent search does not work with Russian words.

if (not ignorCase.Checked) then // Учитывать регистр begin SQLQuery.SQL.Text := 'select * from `' +DBNAME+'` WHERE name LIKE ('#39'%'+ItemName.Text+'%'#39') ORDER BY grp DESC, GID DESC'; end else // Не учитывать регистр begin SQLQuery.SQL.Text := 'select * from `' +DBNAME+'` WHERE LOWER(name) LIKE LOWER('#39'%'+ItemName.Text+'%'#39') ORDER BY grp DESC, GID DESC'; end; 

Is there a ready-made adequate solution for Delphi, which is better than a bicycle with a second column? :(

  • 2
    Actually, your question is not related to Delphi, since the problem is on the side of SQLite. The solution is here: SQLite - LIKE - zed
  • However, through Delphi you can hang the splice on the function and create your own original crutch :) - Robert
  • Yes you can. Personally, I used this option: I got the FTS3 table and inserted lower-case strings and, accordingly, the entire search went through MATCH using this table. But on Habré write that the most scary option - to use ICU : SQLite and full UNICODE - zed
  • Link to another topic on the topic: Sqlite ignore case in the condition WHERE - zed

1 answer 1

  1. Create an additional field in SQLite - nameUpper
  2. When saving from Delphi, save the Upper() value in the nameUpper field
  3. When searching, look for their nameUpper field but show the values ​​from the name field