Unix Technical Forum

How do i guarantee sorting using UCS-2 character set?

This is a discussion on How do i guarantee sorting using UCS-2 character set? within the Informix forums, part of the Database Server Software category; --> Hi: How do I sort always in UCS-2 character set. Even if my CHAR and NCHAR column character set ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 08:30 AM
Irfan Bondre
 
Posts: n/a
Default How do i guarantee sorting using UCS-2 character set?

Hi:
How do I sort always in UCS-2 character set. Even if my CHAR and NCHAR
column character set is different.


Thanks,
Irfan


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 08:30 AM
Art S. Kagel
 
Posts: n/a
Default Re: How do i guarantee sorting using UCS-2 character set?

Irfan Bondre wrote:
> Hi:
> How do I sort always in UCS-2 character set. Even if my CHAR and NCHAR
> column character set is different.


It's only possible with IDS 9.40+ using the SET COLLATION statement in the
session that requires the alternate ordering. SET NO COLLATION reverts the
session to default ordering.

Art S. Kagel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 08:31 AM
Irfan Bondre
 
Posts: n/a
Default Re: How do i guarantee sorting using UCS-2 character set?

Hi:

But Set Collation only effects NCHAR and NVARCHAR data...
From Informix GLS user guide
"The SET COLLATION statement can specify the localized collating order of

a locale that is different from what DB_LOCALE specifies. This localized

collation is applied to sorting operations on NCHAR and NVARCHAR data

types in the same session. Database objects that sort NCHAR or NVARCHAR

values use the collating order that was in effect when the object was
created,

if this differs from the DB_LOCALE setting."

What about CHAR and VARCHAR columns ?

Irfan.


"Art S. Kagel" <kagel@bloomberg.net> wrote in message
news:41F7B0EC.9090309@bloomberg.net...
> Irfan Bondre wrote:
> > Hi:
> > How do I sort always in UCS-2 character set. Even if my CHAR and NCHAR
> > column character set is different.

>
> It's only possible with IDS 9.40+ using the SET COLLATION statement in the
> session that requires the alternate ordering. SET NO COLLATION reverts

the
> session to default ordering.
>
> Art S. Kagel



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 08:31 AM
Jonathan Leffler
 
Posts: n/a
Default Re: How do i guarantee sorting using UCS-2 character set?

Irfan Bondre wrote:

> But Set Collation only effects NCHAR and NVARCHAR data...
> From Informix GLS user guide
> "The SET COLLATION statement can specify the localized collating
> order of a locale that is different from what DB_LOCALE specifies.
> This localized collation is applied to sorting operations on NCHAR
> and NVARCHAR data types in the same session. Database objects that
> sort NCHAR or NVARCHAR values use the collating order that was in
> effect when the object was created, if this differs from the
> DB_LOCALE setting."
>
> What about CHAR and VARCHAR columns ?



Cast to NCHAR or NVARCHAR before comparing?

I didn't say it was nice - just that it should work.

> "Art S. Kagel" <kagel@bloomberg.net> wrote:
>>Irfan Bondre wrote:
>>>How do I sort always in UCS-2 character set. Even if my CHAR and NCHAR
>>>column character set is different.

>>
>> It's only possible with IDS 9.40+ using the SET COLLATION
>> statement in the session that requires the alternate ordering.
>> SET NO COLLATION reverts the session to default ordering.




--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com