Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Function based unique constraint
Different project teams in Oracle often seem
to come up with minor conflicts in detail. The
statement about unique indexes being
frowned upon pre-dates the introduction of
function-based indexes. Your only option is
to create a unique index not a unique constraint.
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison-Wesley Book bound date: 8th Dec 2000 See a first review at: http://www.ixora.com.au/resources/index.htm#practical_8i More reviews at: http://www.jlcomp.demon.co.uk/book_rev.html Brian Tkatch wrote in message <3a1ec370.327615406_at_news.alt.net>...Received on Fri Nov 24 2000 - 15:10:00 CST
>Just reading the docs:
>
>Oracle recommends that you do not explicitly define UNIQUE indexes on
>tables. Uniqueness is strictly a logical concept and should be
>associated with the definition of a table. Therefore, define UNIQUE
>integrity constraints on the desired columns.
>
>Following the recomendation, I changed three of the four unique
>indexes to be unique constraints (though, it seems they both create
>the other). The fourth one, however, is function based. Is there a way
>to create function based unique constraint, or must the unique key be
>defined as an index.
>
>create table a(a varchar2(1), constraint a1_a_uq unique(lower(a));
>create table a(a varchar2(1), constraint a1_a_uq unique(lower(a))
> *
>ERROR at line 1:
>ORA-00907: missing right parenthesis
>
>The asterisk was under the parenthesis between "lower" and "a".
>
>
>Brian