Subject | Re: [firebird-support] Re: Case insensitive collations |
---|---|
Author | Alexandre Benson Smith |
Post date | 2006-03-28T15:37:50Z |
Sean Cross wrote:
FB 2.0 has support for case insensitive collations I use a collation
named PT_BR that is case/accent insensitive.
This collation come from a brazilian "fork" of FB, in truth, it is not a
fork, it is just the same FB code with this collation implemented.
If you wish you could try it (it is stable and I run it for some years)
www.sourceforge.net/projects/firebirdptbr
a sample will be like this:
create Table MyTest(Name varchar(40) charset iso8859_1 collate PT_BR);
create index idx_Name on MyTest(name);
commit;
insert into MyTest values ('aBc');
insert into MyTest values ('Ábç'');
insert into MyTest values ('ãBC');
insert into MyTest values ('àbc');
insert into MyTest values ('ÃbC');
insert into MyTest values (''ÄBÇ');
insert into MyTest values ('ABC');
commit;
all the bellow queries will return all records with indexed reads:
select * from MyTeste where Name = 'abc'
select * from MyTeste where Name = 'ábç'
select * from MyTeste where Name like 'A%'
select * from MyTeste where Name like 'á%'
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
> The first one is a bit of a nasty hack. The second is an improvement.Hi Sean,
> However I think a case insesitive collation would be a better answer. Is
> there a reason why this has never been added. There seems to be a fair
> demand for it.
>
>
> Regards
>
> Sean
>
FB 2.0 has support for case insensitive collations I use a collation
named PT_BR that is case/accent insensitive.
This collation come from a brazilian "fork" of FB, in truth, it is not a
fork, it is just the same FB code with this collation implemented.
If you wish you could try it (it is stable and I run it for some years)
www.sourceforge.net/projects/firebirdptbr
a sample will be like this:
create Table MyTest(Name varchar(40) charset iso8859_1 collate PT_BR);
create index idx_Name on MyTest(name);
commit;
insert into MyTest values ('aBc');
insert into MyTest values ('Ábç'');
insert into MyTest values ('ãBC');
insert into MyTest values ('àbc');
insert into MyTest values ('ÃbC');
insert into MyTest values (''ÄBÇ');
insert into MyTest values ('ABC');
commit;
all the bellow queries will return all records with indexed reads:
select * from MyTeste where Name = 'abc'
select * from MyTeste where Name = 'ábç'
select * from MyTeste where Name like 'A%'
select * from MyTeste where Name like 'á%'
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br