On 1/7/15, The Responsa Project <gr.respo...@biu.ac.il> wrote:
> To Whom it amy concern
>
>
> I am trying to use SQLITE and the like statement with wildcards and hebrew
>
> when I put in an english string it works correctly, such as
>
> Select  * from dbname where colname like '%123%'
>
> I will get all the entries from that column that contain 123 anywhere in the
> column.
>
> However if I substitute 123 with hebrew letters - it matches all the
> entries, not just the ones containing what I asked for.
>
> If I do not use the wilcards in the like it matches the exact word properly.
> In version 3.2.2 of sqlite this worked fine (with wildcards), later versions
> it does not. So for example "SELECT * from dbname where colname like '%אב%'
> will give me all the entries not only the ones matching only אב.
>

It should work.  Here is the test case I used:

CREATE TABLE t1(x TEXT);
INSERT INTO t1(x) VALUES('abc'),('אב'),
  ('בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ'),
  ('וְהָאָ֗רֶץ הָיְתָ֥ה תֹ֙הוּ֙ וָבֹ֔הוּ '),('xyz');
.print --- all ---
SELECT rowid, x FROM t1;
.print --- Using %אב% ---
SELECT rowid, x FROM t1 WHERE x LIKE '%אב%';

The above gives me this output:

--- all ---
1|abc
2|אב
3|בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ
4|וְהָאָ֗רֶץ הָיְתָ֥ה תֹ֙הוּ֙ וָבֹ֔הוּ
5|xyz
--- Using %אב% ---
2|אב

Which is exactly what you would expect, no?

Perhaps you can give us more details about how you are invoking
SQLite.  The problem might be in the interface to your programming
language, not in SQLite itself.


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to