In a vaguely similar situation I wrote a custom collation that converted
accented letters to their non-accented cousins. Since the conversion is
on a case-by-case basis I also had to do a pre-screening that would show
any non-ascii characters that I wasn't converting, so that I could add
them to my collation.
This is not quite what you want, since (I think) you want O and Ö and Ó
to be distinct, but the same sort of technique should work for you.
Convert everything to upper (or lower) case brute force. Perhaps tedious
to set up, but straightforward.
Gerry
On 10/24/2014 9:54 AM, dd wrote:
Hi,
ö and Ö same character but case different. I dont want to allow to insert
two entries for same data with different case. It works well with ascii
set. How to handle this? any inputs welcome.
$./sqlite3 '/home/xxxx/sqlite/test/a.db'
SQLite version 3.8.7 2014-10-17 11:24:17
Enter ".help" for usage hints.
sqlite> .fullschema
CREATE TABLE test(id integer primary key autoincrement, t text collate
nocase, unique(t));
/* No STAT tables available */
sqlite> insert into test(t) values('a');
sqlite> insert into test(t) values('A');
Error: UNIQUE constraint failed: test.t
sqlite> .headers on
sqlite> select * from test;
id|t
1|a
sqlite> insert into test(t) values('ö');
sqlite> insert into test(t) values('Ö');//issue: allowed to insert. Expects
constraint failed err. But, not.
sqlite> select * from test;
id|t
1|a
2|ö
3|Ö
sqlite> .q
Thanks,
dd
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users