-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 'ALTER SESSION SET NLS_SORT=SCHINESE_PINYIN_M' doesn't work
PostPosted: Thu Apr 03, 2008 2:43 am 
Newbie

Joined: Mon Aug 14, 2006 4:52 am
Posts: 7
I want to get a list sort by some Chinese column with SCHINESE_PINYIN_M, so I write code as following:
session.createSQLQuery("ALTER SESSION SET NLS_SORT=SCHINESE_PINYIN_M");
List accounts = session.createCriteria(Account.class).addOrder(Order.asc("chineseName")).list();

But it doesn't work, so I rewrite the query as following:
accounts = session.createQuery("from Account order by NLSSORT(chineseLegalName,'NLS_SORT=SCHINESE_PINYIN_M')").list();

It works, the problem is I need to alter the session parameter as there are too many places need to sort by Chinese column, What shall I do?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.