db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmclea...@comcast.net
Subject Re: Unique case-insensitive constraint on a varchar column
Date Thu, 24 Aug 2006 12:31:38 GMT
My recommendation is that you somehow force all data stored in that column to the same case.
It may not be a perfect solution but then, this problem strikes me as rare enough that there
may not be a better one.

Donald

 -------------- Original message ----------------------
From: Ziad Mansouri <zmansour@yahoo.com>
> Mates,
> 
> I'm trying to create a constraint, on a varchar
> column, which is case insensitive.  Here's the table:
> 
> create table categories (
> 	category_id int not null generated always as identity
> primary key,
> 	category varchar(64) not null
> 	);
> 
> I've tried:
> 
>    category varchar(64) not null unique
> 
> but then these two inserts are OK when I don't want
> them to be:
> 
> 	insert into categories(category) values('Test');
> 	insert into categories(category) values('test');

Mime
View raw message