Subject | Problems using LIKE with UNICODE |
---|---|
Author | pavel_menshchikov |
Post date | 2003-10-18T11:59:41Z |
Hi!
I have DB. Its definition part is below.
-----
SET SQL DIALECT 3;
SET NAMES UNICODE_FSS;
CREATE DATABASE 'C:\MyProjects\ENG\IBDB\AC011.GDB'
USER 'SYSDBA' PASSWORD 'masterkey' PAGE_SIZE 8192
DEFAULT CHARACTER SET UNICODE_FSS;
CREATE DOMAIN CH10 AS VARCHAR(10);
CREATE DOMAIN CH50 AS VARCHAR(50);
/* ... */
CREATE TABLE ROOMS (
PRJCODE INTEGER NOT NULL,
ROOMNO CH10 NOT NULL,
NAME CH50
/* ... */
);
-----
The problem occures when doing statements like this:
-----
SELECT * FROM ROOMS WHERE NAME LIKE 'string_in_russian%'
-----
When starting the statement, FireBird/InterBase server goes down
(under MS Windows, I tried IB6, FB1, FB1.5RC6). If I
use 'string_in_english' instead of 'string_in_russian', the query
returns right rows. The query returns right rows when DEFAULT
CHARACTER SET is WIN1251. Query like
-----
SELECT * FROM ROOMS WHERE UPPER(NAME) LIKE UPPER('STRING_IN_RUSSIAN%')
-----
(that's right: UPPER('STRING_IN_UPPER') - it described in
bugs/features of FB1 as I remember) returns all rows where NAME
contains cyrillic symbols. The same result (rows with all cyrillic
names) when doing statement
-----
SELECT * FROM ROOMS WHERE NAME LIKE 'string_in_russian%' COLLATE
UNICODE_FSS
-----
Question: can I fix that myself? If yes, please show me how. If no,
please give me an idea of construction to substitute the statements
above.
Best regards,
Pavel
I have DB. Its definition part is below.
-----
SET SQL DIALECT 3;
SET NAMES UNICODE_FSS;
CREATE DATABASE 'C:\MyProjects\ENG\IBDB\AC011.GDB'
USER 'SYSDBA' PASSWORD 'masterkey' PAGE_SIZE 8192
DEFAULT CHARACTER SET UNICODE_FSS;
CREATE DOMAIN CH10 AS VARCHAR(10);
CREATE DOMAIN CH50 AS VARCHAR(50);
/* ... */
CREATE TABLE ROOMS (
PRJCODE INTEGER NOT NULL,
ROOMNO CH10 NOT NULL,
NAME CH50
/* ... */
);
-----
The problem occures when doing statements like this:
-----
SELECT * FROM ROOMS WHERE NAME LIKE 'string_in_russian%'
-----
When starting the statement, FireBird/InterBase server goes down
(under MS Windows, I tried IB6, FB1, FB1.5RC6). If I
use 'string_in_english' instead of 'string_in_russian', the query
returns right rows. The query returns right rows when DEFAULT
CHARACTER SET is WIN1251. Query like
-----
SELECT * FROM ROOMS WHERE UPPER(NAME) LIKE UPPER('STRING_IN_RUSSIAN%')
-----
(that's right: UPPER('STRING_IN_UPPER') - it described in
bugs/features of FB1 as I remember) returns all rows where NAME
contains cyrillic symbols. The same result (rows with all cyrillic
names) when doing statement
-----
SELECT * FROM ROOMS WHERE NAME LIKE 'string_in_russian%' COLLATE
UNICODE_FSS
-----
Question: can I fix that myself? If yes, please show me how. If no,
please give me an idea of construction to substitute the statements
above.
Best regards,
Pavel