Subject | fbintl2.dll : how to implement succesful 'LIKE' matching? |
---|---|
Author | masotti |
Post date | 2004-12-06T11:27:47Z |
I've made a early pre-alpha test of a Delphi project building a
fbintl2.dll, following hints founds in Internet.
Aside some strange things (access violation that don't crash server in
inital loading and final releasing DLL) seems that all work as expected.
I've made a collation named 'TELEFONIC_EX' for WIN1252 character set,
where only characters '0'..'9', 'A'..'Z', 'a'..'z' and usually italian
other character (vowels with accents) are needed to form the final key,
all other characters are skipped (to do: shifted at the end of previous
list to make a better ordering).
CREATE TABLE AAAA (
A1 CHAR(10) CHARACTER SET WIN1252 COLLATE WIN1252,
A2 CHAR(10) CHARACTER SET WIN1252 COLLATE TELEFONIC_EX);
Values in fieds A1 and A2 are identical, and are like
**001
*000*
00***
**AAA
*=AA=
^AAAA
AAA**
AA**
AaaAA
In SQL statements like 'SELECT * FROM AAAA ORDER BY A2', output is as
expected:
VALUE: KEY:
00*** 00
*000* 000
**001 001
*=AA= AA
AA** AA
**AAA AAA
AAA** AAA
^AAAA AAAA
AaaAA AaaAA
but when searching for
'SELECT * FROM AAAA WHERE A2 LIKE 'A%'
result set has only three rows:
VALUE: KEY:
AA** AA
AAA** AAA
AaaAA AaaAA
But log in my D7 proj states that string_to_key() conversion function is
called for all values having key starting with 'A'
What I've missed from docs about fbintl2 to do what I need?
Can anyone help, please?
TIA.
Ciao.
Mimmo.
fbintl2.dll, following hints founds in Internet.
Aside some strange things (access violation that don't crash server in
inital loading and final releasing DLL) seems that all work as expected.
I've made a collation named 'TELEFONIC_EX' for WIN1252 character set,
where only characters '0'..'9', 'A'..'Z', 'a'..'z' and usually italian
other character (vowels with accents) are needed to form the final key,
all other characters are skipped (to do: shifted at the end of previous
list to make a better ordering).
CREATE TABLE AAAA (
A1 CHAR(10) CHARACTER SET WIN1252 COLLATE WIN1252,
A2 CHAR(10) CHARACTER SET WIN1252 COLLATE TELEFONIC_EX);
Values in fieds A1 and A2 are identical, and are like
**001
*000*
00***
**AAA
*=AA=
^AAAA
AAA**
AA**
AaaAA
In SQL statements like 'SELECT * FROM AAAA ORDER BY A2', output is as
expected:
VALUE: KEY:
00*** 00
*000* 000
**001 001
*=AA= AA
AA** AA
**AAA AAA
AAA** AAA
^AAAA AAAA
AaaAA AaaAA
but when searching for
'SELECT * FROM AAAA WHERE A2 LIKE 'A%'
result set has only three rows:
VALUE: KEY:
AA** AA
AAA** AAA
AaaAA AaaAA
But log in my D7 proj states that string_to_key() conversion function is
called for all values having key starting with 'A'
What I've missed from docs about fbintl2 to do what I need?
Can anyone help, please?
TIA.
Ciao.
Mimmo.