Using 'alter session set nls_sort' doesn't seem to work for me. I use SQLPlus v11.2.0.3.0 x64 and try to apply simple steps to "Example 9-10. NLS_SORT affects the linguistic sort order" found in the Oracle documentation at http://docs.oracle.com/cd/E18283_01/appdev .112 / e10766 / tdddg_globalization.htm # CACJEJIB
CREATE TABLE temp (name VARCHAR2(15));
INSERT INTO temp (name) VALUES ('laguna');
INSERT INTO temp (name) VALUES ('llama');
INSERT INTO temp (name) VALUES ('loco');
SELECT * FROM nls_session_parameters WHERE parameter = 'NLS_SORT';
Result: BINARY
SELECT * FROM temp ORDER BY name;
Result:
NAME
laguna
llama
loco
ALTER SESSION SET NLS_SORT=SPANISH_M;
SELECT * FROM nls_session_parameters WHERE parameter = 'NLS_SORT';
Result: SPANISH_M
SELECT * FROM temp ORDER BY name;
Results are the same:
NAME
laguna
llama
loco
According to doco, the sort order above should have changed, but it is not. But, if I applied NLS_SORT as part of the request itself, I get the correct values:
SELECT * FROM temp ORDER BY NLSSORT(name, 'NLS_SORT=SPANISH_M');
Result:
NAME
laguna
loco
llama
What am I missing here? thanks in advance.
source
share