1

Have huge data in Oracle DB. To search datas we create WPF application. When user type symbol like A%, query should seacrh both, in Latin and in Cyrillic word. Symbols already recorded in Cyrillic in DB. Column type varchar2(20byte) and can not be changed type. In query I tried,

Select *
from Table1
where symbol=N'A'; // A - Latin symbol 

but no result. I in query I put Cyrillic symbol there is result.

How to od it?

6
  • 1
    Does every cyrillic glyph have an unambiguous latin counterpart?
    – Fildor
    Jun 6 at 9:36
  • not all, A, O, E,C, K and some more Jun 6 at 9:41
  • And do you restrict "searchable" characters to those? Or what can users enter in general? Just single chars?
    – Fildor
    Jun 6 at 9:43
  • they will enter like A54186, K51786, AK574178, CC015687, AKC962896 or AKCOE etc. Jun 6 at 9:50
  • Ok, in such cases you need to get hits on for example "A54186" as well as "А54186" (the cyrillic one), I see now.
    – Fildor
    Jun 6 at 9:56

1 Answer 1

0

If you only have a limited number of characters then you can use TRANSLATE to substitute the Cyrillic character(s) to their ASCII equivalent(s):

SELECT *
FROM   Table1
WHERE  TRANSLATE(symbol, UNISTR('\0410'), 'A') = 'A';

Which, for the sample data:

CREATE TABLE table1 (symbol VARCHAR2(10));
INSERT INTO table1 (symbol) VALUES ('A');
INSERT INTO table1 (symbol) VALUES (UNISTR('\0410'));

Outputs:

SYMBOL
A
А

fiddle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.