Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Irfan Bondre asked how to always sort in UCS-2 order even when CHAR and NCHAR columns use different character sets. Art S. Kagel said SET COLLATION in IDS 9.40+ does it per session, but Irfan noted it only affects NCHAR and NVARCHAR. Jonathan Leffler suggested casting to NCHAR or NVARCHAR before comparing, admitting it is not nice but should work.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi:
How do I sort always in UCS-2 character set. Even if my CHAR and NCHAR
column character set is different.
Thanks,
Irfan
↪ replying to Irfan Bondre
Art S. Kagel — — source: Usenet: comp.databases.informix
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
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/
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.