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

Home -> Community -> Usenet -> c.d.o.server -> Re: Test if Data for a Field is UNIQUE

Re: Test if Data for a Field is UNIQUE

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 24 Jan 2006 10:25:57 -0800
Message-ID: <1138127155.85808@jetspin.drizzle.com>


Walt wrote:

> I don't think there's any functional difference between
>
> CREATE UNIQUE INDEX ...
>
> and
>
> ALTER TABLE FOO
> ADD CONSTRAINT BAR
> UNIQUE (COL1)
Actually there is. One, of course, being the ability to defer or disable a constraint ... but almost as important is the fact that with a UNIQUE INDEX no entry can be found in user_constraints whereas with the creation of a UNIQUE CONSTRAINT you will find entries in both user_constraints and user_indexes.

I advise my students to NEVER build a unique index.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Tue Jan 24 2006 - 12:25:57 CST

Original text of this message

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