Home » RDBMS Server » Server Administration » Japanese string comparison?
Japanese string comparison? [message #374098] Thu, 24 May 2001 11:42
i18n amateur
Messages: 1
Registered: May 2001
Junior Member
Hello,

Is there anyway to use Oracle 8's functionality to match Japanese text entered using Katakana with its equivalent entered in Hiragana? Using a UTF-8 character set for the db, I've tried setting NLS_LANG to Japanese_japan.UTF8 and NLS_SORT to ASCII, and using NLSSORT to compare the two values, but no dice. Is this possible at all using some other setup (e.g. using a Shift-JIS character set or some other SQL functions), or am I trying to do the impossible?

[[Note that I don't know Japanese myself, I'm just going by what the Japanese client is asking me to implement.]]

To explain further: we're using an Oracle 8i database on a Solaris box; there is this one table field "title" that contains some text, and using Perl and SQL we'd like to "search" on the "title", i.e. the user enters a keyword and we find all records in this table where the keyword appears in the "title" field's value. This title is in Japanese, and may be entered using a mixture of Katakana, Hiragana, regular Latin characaters, or the double-byte Latin characters that are part of the Japanese character set.

The problem: if the title is stored in Katakana, but the user searches for the same text entered in Hiragana, we'd like to see a match. But right now the two texts are treated as being different, i.e. the SQL where clause "WHERE NLSSORT(:keyword) = NLSSORT(title)" is never true. The same goes for matching text stored in regular ASCII-Latin characters and the same text stored in double-byte Latin characters.

Any help would be greatly appreciated. Thanks.
Previous Topic: Removing Duplicate Rows
Next Topic: Help! Where clause using TO_DATE
Goto Forum:
  


Current Time: Wed Jul 03 16:59:13 CDT 2024