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: Walt <walt_askier_at_SHOESyahoo.com>
Date: Mon, 23 Jan 2006 16:57:36 -0500
Message-ID: <kjcBf.2987$yb2.932@news.itd.umich.edu>


Mladen Gogala wrote:

> BTW, you don't need unique index to have a unique constraint.

Well, yes and no. In theory it is possible to have a unique constraint without an index. But Oracle will create an index for you when you create a unique constraint. You can test this by creating a unique constraint and querying the all_indexes table. There's an index there with your constraint name.

I don't think there's any functional difference between

CREATE UNIQUE INDEX ... and

ALTER TABLE FOO
  ADD CONSTRAINT BAR
  UNIQUE (COL1)
> You can have a unique constraint on the column even the values in the column are not unique.

I'm not sure what this means.

//Walt Received on Mon Jan 23 2006 - 15:57:36 CST

Original text of this message

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