Question

Using 'alter session set nls_sort' does not seem to be working for me. I am using SQLPlus v11.2.0.3.0 x64 and trying to apply the simple steps for 'Example 9-10 NLS_SORT Affects 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 the doco, the sort order above should have changed but it did not. But, if I apply the NLS_SORT as part of the query itself I get the correct resutls:

SELECT * FROM temp ORDER BY NLSSORT(name, 'NLS_SORT=SPANISH_M');
Result:
NAME
---------------
laguna
loco
llama

What am I missing here? Thx in advance.

Was it helpful?

Solution

This was resolved whe I uninstalled Oracle v11.2.0.3.0 and installed v12.1.0.1.0. Truth be told, I can't rule out that it may have just been a problem with our wrapper/configuration of the v11.2.0.3.0 Oracle installer or Oracle itself. Thx for all the post just the same.

OTHER TIPS

The solution is:

1) Go to the REGISTRY (run regedit)
2) Find HKEY_LOCAL_MACHINE/Software/ORACLE
3) Change NLS_LANG

I changed it to

AMERICAN_AMERICA.AR8MSWIN1256

dont forget that you must change all the NLS_LANG in part 2. now you can login to your database and test it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top