If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Database Internationalization (i18n) and Collation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-12-10, 21:56
tcliam tcliam is offline
Registered User
 
Join Date: Oct 2009
Posts: 37
Database Internationalization (i18n) and Collation

Hi guys

Assuming that the solutions to my problem aren't technology specific I have posted this here.
The issue that I am facing is that we are going to internationalize our application and we have a large amount of stored procedures/queries in or code. So within all of this logic there are queries with "ORDER BY" and a string column, which would order the results based on the collation e.g. alphabetical order for English. Assuming that there will be many more problems like this what is the best way to manage the requirements of needing multiple collations within databases. The only solution that I know of is by using a separate database for each language/locale, which I imagine could become very difficult to manage.
If anyone knows some better solutions to this please let me know.

Thanks
Liam
Reply With Quote
  #2 (permalink)  
Old 07-13-10, 03:30
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
I will hold my hands up now and state that I have never had to worry about this problem. However, I think it is another example of why data order should be considered the job of the presentation layer and not the back end. Return unordered result sets to the front end and put your locale specific ordering logic there.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 07-13-10, 03:37
tcliam tcliam is offline
Registered User
 
Join Date: Oct 2009
Posts: 37
Yes this is very true. I suppose considering the amount of work that will be involved in a project like this redesigning the way these types of queries work is probably not going to be that much of a big deal.

Thanks for the reply.
Reply With Quote
  #4 (permalink)  
Old 07-13-10, 11:34
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
This is definitely a presentation issue when dealing with small result sets (under 1000 rows).

There are ways to deal with this at the database level when necessary for large result sets (such as paging issues), but that's a can of worms you're better off leaving unopened unless you really need to deal with it.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #5 (permalink)  
Old 07-13-10, 12:04
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Not something I have ever had to do either, but Oracle does allow you to set the sort collation sequence at the session level, so different users could potentially seet different sorts for the same data. See Oracle: Linguistic Sorting and String Searching if you want to know more.

Example (based on the above link):
Code:
SQL> SELECT * FROM test3 ORDER BY name;

NAME
--------------------
Diet
Freizeit
À voir

SQL> alter session set  nls_sort='german'
  2  /

Session altered.

SQL> SELECT * FROM test3 ORDER BY name;

NAME
--------------------
À voir
Diet
Freizeit
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On