RE: Creating unique indexes with no case sensitive?
Posted in 2000
Topics: Stored Procedures & SPL, Data Types & Schema Design, Triggers, Constraints & Referential Integrity
You should be do this by creating a function such as the one below:
create function func1(arg varchar(255)) returns varchar(255) with
(not variant)
return upper(arg); end function;
And use the create index statement such as this one:
create unique index index_idx on table_name (nvupper(colname)) usingbtree ;
Hope this helps.
Don
-----Original Message-----
From: rafaelpadilla@my-deja.com [mailto:rafaelpadilla@my-deja.com]
Sent: Wednesday, November 01, 2000 6:54 PM
To: informix-list@iiug.org
Subject: Creating unique indexes with no case sensitive?
Hello,
I'm looking for the best way to implement a unique constraint or index
which doesn't accept a string two times, that is,
If I wrote in a table the string 'Rafael' and later if I intented to
write the string 'RAFAEL' It doesn't permit this...
Because UNIQUE only validate against exactly strings I can't use only
this word...
I hope someone can help me!
Thank's in advance!
Sent via Deja.com http://www.deja.com/
Before you buy.
Only works with version 9.x servers!!
For other servers create a second column storing the uppercase
version of the first column, Index it and use the uppercase column
for searches.
David.
Don Ignacio wrote in message <8trulk$ftl$1@news.xmission.com>...
>
>You should be do this by creating a function such as the one below:
>
> create function func1(arg varchar(255)) returns varchar(255) with
>(not variant)
> return upper(arg);> end function;
>
>And use the create index statement such as this one:
>
> create unique index index_idx on table_name (nvupper(colname)) using>btree ;
>
>Hope this helps.
>
>
>Don
>
>-----Original Message-----
>From: rafaelpadilla@my-deja.com [mailto:rafaelpadilla@my-deja.com]
>Sent: Wednesday, November 01, 2000 6:54 PM
>To: informix-list@iiug.org
>Subject: Creating unique indexes with no case sensitive?
>
>
>Hello,
>I'm looking for the best way to implement a unique constraint or index
>which doesn't accept a string two times, that is,
>If I wrote in a table the string 'Rafael' and later if I intented to
>write the string 'RAFAEL' It doesn't permit this...
>
>Because UNIQUE only validate against exactly strings I can't use only
>this word...
>
>I hope someone can help me!
>
>Thank's in advance!
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.