Re: What is unique_id in Oracle and what's the use of it

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Wed, 30 Jan 2008 06:36:18 -0800 (PST)
Message-ID: <cb36d01e-3e1f-4d69-87af-3560c73a48ce@i29g2000prf.googlegroups.com>


On Jan 30, 6:01 am, venki <venkat..._at_gmail.com> wrote:
> On Jan 30, 8:47 am, newa <DavidLL..._at_gmail.com> wrote:
>
> > Hi,
>
> > I am new to Oracle and today someone asked me about the "fference
> > between unique_id and primary key. Which to use and why?" I know about
> > the primary key but not unique_id. Can someone kindly give me an
> > overview of it?
>
> > Thanks in advance.
>
> Primary key is the combination of NOTNULL constraint and unique key
> constraint.
> so it ll never allow duplicate and null value.But unique key  allows
> number of null value but it never allow duplicate value.
> Do not compare this to MS sqlserver, bcoz it some what different from
> oracle to sql. Bcoz unique key will alow only one null value.
>
> venki

This question or minor variations of it have been asked many times. Here is a brief explanation of what PK, UK, and FK constraints are and the indexes used to support them.

What is the difference between a unique index and a unique constraint?

        http://www.jlcomp.demon.co.uk/faq/uk_idx_con.html

HTH -- Mark D Powell -- Received on Wed Jan 30 2008 - 08:36:18 CST

Original text of this message