Oracle database sorted by Chinese pinyin, nls_sort settings
Source: Internet
Author: User
Before Oracle9i, Chinese is sorted according to binary encoding. In oracle9i, according to pinyin, radical, stroke sorting function.
1, set the Nls_sort parameter value
Schinese_radical_m sorted by radical (first order), stroke (second order)
Schinese_stroke_m sorted by stroke (first order), radical (second order)
Schinese_pinyin_m sorted by Pinyin
2, the session level settings, modify the Oracle field default sorting method:
by Pinyin: Alter session set nls_sort = Schinese_pinyin_m;
By stroke: Alter session set nls_sort = Schinese_stroke_m;
By radicals: Alter session set nls_sort = Nls_sort=schinese_radical_m;
3, the statement level set sorting method:
Oracle Sorted by Stroke
Select * FROM [TableName] to Nlssort (colname, ' nls_sort=schinese_stroke_m ');
Oracle sorted by radical
Select * FROM [TableName] to Nlssort (colname, ' nls_sort=schinese_radical_m ');
Oracle sorted by Pinyin
Select * FROM [TableName] to Nlssort (colname, ' nls_sort=schinese_pinyin_m ');
4. Modify system parameters (Database operating system):
Set Nls_sort=schinese_radical_m export Nls_sort (SH)
Setenv nls_sort schinese_radical_m (CSH)
Hklc\software\oracle\home0\nls_sort (Win registration form)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service