Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Function based unique constraint

Function based unique constraint

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Fri, 24 Nov 2000 19:42:09 GMT
Message-ID: <3a1ec370.327615406@news.alt.net>

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 Received on Fri Nov 24 2000 - 13:42:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US