... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2005-04-28

Oracle NLS

You can make Oracle change the character sort order using the NLSSORT function, eg:

select * from (
  select 'ab' x from dual
  union select 'Az' from dual
  union select 'Bz' from dual
  union select 'äm' from dual
  union select 'ba' from dual ) x
order by nlssort(x, 'NLS_SORT=LATIN')

will give the results:

ab
äm
Az
ba
Bz

You can obtain a list of valid sort orders by running the query:

select * from v$nls_valid_values where parameter='SORT' order by 1, 2

Blog Archive