db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lolas <loho...@dconstans.hu>
Subject Re: Order by clause with national character set
Date Tue, 18 Mar 2008 15:19:57 GMT

Hello Knut!
Thanks for your answer, it was very hepfully. I beg your pardon for this
late answer, I haven't known that I made this thread. I have registered just
now.
LL


Knut Anders Hatlen wrote:
> 
> Lohonya László <lohonya@dconstans.hu> writes:
> 
>> Hi,
>>  
>> I want to use a SQL statement with ORDER BY clause along with VARCHAR
>> elements in which there are some national character (á,Á, ű,Ű, etc). Our
>> (Hungarian)alphabet is: aA, áÁ, bB, cC, ... 
>> How do I setup my Derby database to make these arrangements properly?
> 
> Hi,
> 
> It sounds like you need territory-based collation. Take a look at these
> pages in Derby Developer's Guide:
> 
> http://db.apache.org/derby/docs/10.3/devguide/tdevdvlpcollation.html
> http://db.apache.org/derby/docs/10.3/devguide/cdevcollation.html
> 
> Here's a small example:
> 
> ij version 10.4
> ij> connect
> 'jdbc:derby:MagyarDB;create=true;territory=hu_HU;collation=TERRITORY_BASED';
> ij> create table t (x varchar(10));
> 0 rows inserted/updated/deleted
> ij> insert into t values 'aA', 'áÁ', 'bB', 'cC', 'aá', 'áa';
> 6 rows inserted/updated/deleted
> ij> select * from t order by x;
> X         
> ----------
> aA        
> aá        
> áa        
> áÁ        
> bB        
> cC        
> 
> 6 rows selected
> 
> 
> Hope this helps,
> -- 
> Knut Anders
> 
> 

-- 
View this message in context: http://www.nabble.com/Order-by-clause-with-national-character-set-tp15565292p16122341.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message