Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Unique vs UPPERCASE
"elveru" <elveru_at_yahoo.com> wrote in message
news:9srlq4$hu9$1_at_diana.bcn.ttd.net...
> Hello:
>
> I need a column unique, but unique without UPPERCASE or
lowercase, example:
>
> NAME (unique)
ADD
> ....
> BILL
Main Street
> Bill <<<===
Washington Street
>
> I need that this situation isn't possible.
>
In a a system (on 8.0.5) that I recently designed a number
of tables had a column NAME. The values in this should be
unique regardless of case - If 'BILL' was there then 'Bill'
could not be there. However the names were required to be
shown as typed by the user.
I made no constraints on the NAME column but made a
NAME_UPPER column that is populated with upper(NAME) by a on
insert or update row level trigger and NAME_UPPER has a
unique constraint. Values from NAME is used to display. All
selects are done on NAME_UPPER.
It works fine and you wont have an application or programmer
'forget' and insert non unique data.
The drawbacks are a performence penalty due to the trigger
and extra space usage due to double storage of names.
Peter Laursen Received on Tue Nov 13 2001 - 12:46:59 CST
![]() |
![]() |