locale in Spanish
Posted in 2009
Topics: Platform-Specific Issues, Internationalization & Character Sets
Good morning. We have a problem with the locale when we use the order by in
Spanish.
We are running IDS 11.50.UC1 on RedHat Linux 4 and we are using
DB_LOCALE=es_es.cp1252@rae <mailto:DB_LOCALE=es_es.cp1252@rae> .
If we create a table as this
create table javi (apellido1 nchar(20), apellido2 nchar(20));
insert into javi values ("Laborda","Zapatero");
insert into javi values ("Láborda","Zubizarreta");
insert into javi values ("LaBórda","COBO");
insert into javi values ("LaBórda","HIGUES");
insert into javi values ("LABORDA","GOMEZ");
and we execute a SELECT ... order by as this
select apellido1,apellido2
from javi
order by 1 ,2
we obtain
apellido1 apellido2
Laborda Zapatero
LaBórda COBO
LaBórda HIGUES
LABORDA GOMEZ
Láborda Zubizarreta
When the correct it should be :
LaBórda COBO
LABORDA GOMEZ
LaBórda HIGUES
Laborda Zapatero
Láborda Zubizarreta
because in Spanish, accented and non-accented vowels are considered completely
equivalents, in terms of order. This equivalence is achieved for upper and
lower case already.. LaBórda, LABORDA, Laborda and Láborda are completely
equivalents.
When we talk about this with support of IBM they say "It exists an open APAR:
idsdb00165938,. It explain thah we can't order correctly by two fields, that
only is possible to order correctly by one field"
WHEN ORDERING BY 1,2 CHARACTERS WITH ACCENT DOESNT GET THE CORRECT ORDER
I suppose this is a problem for a lot of people in different languages, any
people have a solution?
I have read in GLS manual that is possible to modify a file (*.lc) (but IBM
says that it isn`n supported) to obtain the correct results, but where are the
*,lc files? How we compile it?
Thanks
__________________________________________________
Domingo Fernández. domingo.fernandez@gestion.unican.es
<mailto:domingo.fernandez@gestion.unican.es>
Servicio de Informática <http://www.unican.es/WebUC/Unidades/SdeI/> .
Universidad de Cantabria <http://www.unican.es>
Avda. de los Castros s/n
39005 Santander. España.
Tfno.: 942201084. FAX: 942201083
Hi,
have you tried contacting support?
I had similar case with Croatian language couple of years ago,
and after I teached tech support to Croatian language :o), they fixed
all issues.
Regards,
Hrvoje
Fernandez Garcia, Domingo wrote:
Good morning. We have a problem with the locale when we use the order by in
Spanish.
We are running IDS 11.50.UC1 on RedHat Linux 4 and we are using
DB_LOCALE=es_es.cp1252@rae [1]<mailto:DB_LOCALE=es_es.cp1252@rae> .
If we create a table as this
create table javi (apellido1 nchar(20), apellido2 nchar(20));
insert into javi values ("Laborda","Zapatero");
insert into javi values ("Láborda","Zubizarreta");
insert into javi values ("LaBórda","COBO");
insert into javi values ("LaBórda","HIGUES");
insert into javi values ("LABORDA","GOMEZ");
and we execute a SELECT ... order by as this
select apellido1,apellido2
from javi
order by 1 ,2
we obtain
apellido1 apellido2
Laborda Zapatero
LaBórda COBO
LaBórda HIGUES
LABORDA GOMEZ
Láborda Zubizarreta
When the correct it should be :
LaBórda COBO
LABORDA GOMEZ
LaBórda HIGUES
Laborda Zapatero
Láborda Zubizarreta
because in Spanish, accented and non-accented vowels are considered completely
equivalents, in terms of order. This equivalence is achieved for upper and
lower case already.. LaBórda, LABORDA, Laborda and Láborda are completely
equivalents.
When we talk about this with support of IBM they say "It exists an open APAR:
idsdb00165938,. It explain thah we can't order correctly by two fields, that
only is possible to order correctly by one field"
WHEN ORDERING BY 1,2 CHARACTERS WITH ACCENT DOESNT GET THE CORRECT ORDER
I suppose this is a problem for a lot of people in different languages, any
people have a solution?
I have read in GLS manual that is possible to modify a file (*.lc) (but IBM
says that it isn`n supported) to obtain the correct results, but where are the
*,lc files? How we compile it?
Thanks
__________________________________________________
Domingo Fernández. [2]domingo.fernandez@gestion.unican.es
[3]<mailto:domingo.fernandez@gestion.unican.es>
Servicio de Informática [4]<http://www.unican.es/WebUC/Unidades/SdeI/> .
Universidad de Cantabria [5]<http://www.unican.es>
Avda. de los Castros s/n
39005 Santander. España.
Tfno.: 942201084. FAX: 942201083
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
References
1. mailto:DB_LOCALE=es_es.cp1252@rae
2. mailto:domingo.fernandez@gestion.unican.es
3. mailto:domingo.fernandez@gestion.unican.es
4. http://www.unican.es/WebUC/Unidades/SdeI/
5. http://www.unican.es/
Temporary solution:
create temp table o_names_1( ordered1 serial, apellido1 nchar(20), apellido2nchar(20));
create temp table o_names_2( ordered2 serial, ordered1 int, apellido1nchar(20), apellido2 nchar(20));
insert into o_names_1
select 0, apellido1, apellido2
from javi order by 2;
insert into o_names_2
select 0, ordered1,apellido1, apellido2
from ordered1
order by 3;
select apellido1, apellido2
from ordered2
order by ordered1, ordered2;
Art
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
On Wed, Dec 2, 2009 at 12:44 PM, Fernandez Garcia, Domingo <
domingo.fernandez@gestion.unican.es> wrote:
> Good morning. We have a problem with the locale when we use the order by in
> Spanish.
>
> We are running IDS 11.50.UC1 on RedHat Linux 4 and we are using
> DB_LOCALE=es_es.cp1252@rae <mailto:DB_LOCALE=es_es.cp1252@rae> .>
> If we create a table as this
>
> create table javi (apellido1 nchar(20), apellido2 nchar(20));
> insert into javi values ("Laborda","Zapatero");
> insert into javi values ("Láborda","Zubizarreta");
> insert into javi values ("LaBórda","COBO");
> insert into javi values ("LaBórda","HIGUES");
> insert into javi values ("LABORDA","GOMEZ");>
> and we execute a SELECT ... order by as this
>
> select apellido1,apellido2
> from javi
> order by 1 ,2>
> we obtain
>
> apellido1 apellido2
>
> Laborda Zapatero
>
> LaBórda COBO
>
> LaBórda HIGUES
>
> LABORDA GOMEZ
>
> Láborda Zubizarreta
>
> When the correct it should be :
>
> LaBórda COBO
> LABORDA GOMEZ
> LaBórda HIGUES
> Laborda Zapatero
> Láborda Zubizarreta
>
> because in Spanish, accented and non-accented vowels are considered
> completely
> equivalents, in terms of order. This equivalence is achieved for upper and
> lower case already.. LaBórda, LABORDA, Laborda and Láborda are completely
> equivalents.
>
> When we talk about this with support of IBM they say "It exists an open
> APAR:
> idsdb00165938,. It explain thah we can't order correctly by two fields,
> that
> only is possible to order correctly by one field"
> WHEN ORDERING BY 1,2 CHARACTERS WITH ACCENT DOESNT GET THE CORRECT ORDER
>
> I suppose this is a problem for a lot of people in different languages, any
> people have a solution?
>
> I have read in GLS manual that is possible to modify a file (*.lc) (but IBM
> says that it isn`n supported) to obtain the correct results, but where are
> the
> *,lc files? How we compile it?
>
> Thanks
>
> __________________________________________________
>
> Domingo Fernández. domingo.fernandez@gestion.unican.es
> <mailto:domingo.fernandez@gestion.unican.es>
>
> Servicio de Informática <http://www.unican.es/WebUC/Unidades/SdeI/> .
> Universidad de Cantabria <http://www.unican.es>
>
> Avda. de los Castros s/n
>
> 39005 Santander. España.
>
> Tfno.: 942201084. FAX: 942201083
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--00151747859cbcf30d0479c46aa3
Looking for this APAR , I found this: ------------ IC52311: WRONG LOCALIZED ORDER FOR SPANISH LOCALES http://www-01.ibm.com/support/docview.wss?rs=630&uid=swg1IC52311&loc=en_US&cs=ut f-8&lang=en RECOMMENDATION: Upgrade to IDS 10.00.xC9. Or install locales from ILS 3.40.MC2 ------------- ILS = INTERNATIONAL LANGUAGE SUPPLEMENT The ILS 3.40 MC2 already have in IDS 11.50 UC1 (read the Release Notes). But... in the IDS 11.40 xC3 already have the ILS 3.40 MC3 . I like to suggest install the ILS 3.40 MC3 (if you found it to download) ... but, after execute your test in IDS 11.50 xC5 , the same issues occur, so will be useless. Insist with support, since this APAR say all is already solve, what isn't true. Regards César
sorry I forgot post an example (ids 11.50 UC5) showing the Spanish locale still have problem with order by... if executed with Portuguese locale (pt_br.819), works: ----------------------------- select (apellido1||" "||apellido2)::nvarchar(40) from javi order by 1 (expression) LaBórda COBO LABORDA GOMEZ LaBórda HIGUES Laborda Zapatero Láborda Zubizarreta ----------------------------- if executed with Espanish locale, don't... ----------------------------- select (apellido1||" "||apellido2)::nvarchar(40) from javi order by 1 (expression) Laborda Zapatero LaBórda COBO LaBórda HIGUES LABORDA GOMEZ Láborda Zubizarreta -----------------------------