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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Primary keys vs. unique indexes

RE: Primary keys vs. unique indexes

From: Jeffery Stevenson <jeff_at_mpv.com>
Date: Thu, 30 Nov 2000 11:57:38 -0600
Message-Id: <10696.123335@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01C05AF7.06A9A910
Content-Type: text/plain;

        charset="iso-8859-1"

If you just create a unique index (with CREATE UNIQUE INDEX...) instead of creating a unique constraint (ALTER TABLE ADD CONSTRAINT <name> UNIQUE...  

Jeffery Stevenson
Chief Database Geek
Medical Present Value, Inc.
Austin, TX

-----Original Message-----
From: Koivu, Lisa [mailto:lkoivu_at_qode.com] Sent: Thursday, November 30, 2000 11:20 AM To: Multiple recipients of list ORACLE-L Subject: RE: Primary keys vs. unique indexes

What? Yes you can. I have anyway.

Can you give me an example of when that would not work?

Lisa Rutland Koivu
Oracle Database Administrator
Qode.com
4850 North State Road 7
Suite G104
Fort Lauderdale, FL 33319

V: 954.484.3191, x174 
F: 954.484.2933 
C: 954.658.5849 

http://www.qode.com <http://www.qode.com>

"The information contained herein does not express the opinion or position of Qode.com and cannot be attributed to or made binding upon Qode.com."

-----Original Message-----
From: james ellis [ mailto:jellis24_gso_at_yahoo.com <mailto:jellis24_gso_at_yahoo.com> ]
Sent: Thursday, November 30, 2000 11:51 AM To: Multiple recipients of list ORACLE-L Subject: Re: Primary keys vs. unique indexes

The main difference is you can not reference an unique index with a foreign key.
--- cemail_at_sprintmail.com wrote:
>
> What is the difference between building a table and
> including
> the primary key versus building the table and then
> having creating
> a unique index on the same keys? When you create a
> table with
> a primary key, doesn't Oracle store it as an index
> anyway?
>
> -----
> Sent using MailStart.com (
> http://MailStart.Com/welcome.html <http://MailStart.Com/welcome.html> )
> The FREE way to access your mailbox via any web
> browser, anywhere!
>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com <http://www.orafaq.com>
> --
> Author:
> INET: cemail_at_sprintmail.com
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists
>



> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).


Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ <http://shopping.yahoo.com/>
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
<http://www.orafaq.com>  
-- 
Author: james ellis 
  INET: jellis24_gso_at_yahoo.com 

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051 
San Diego, California        -- Public Internet access / Mailing Lists 
-------------------------------------------------------------------- 
To REMOVE yourself from this mailing list, send an E-Mail message 
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in 
the message BODY, include a line containing: UNSUB ORACLE-L 
(or the name of mailing list you want to be removed from).  You may 
also send the HELP command for other information (like subscribing). 


------_=_NextPart_001_01C05AF7.06A9A910
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>RE: Primary keys vs. unique indexes</TITLE>

<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=489124817-30112000>If you just create a 
unique index (with CREATE UNIQUE INDEX...) instead of creating a unique 
constraint (ALTER TABLE ADD CONSTRAINT &lt;name&gt; 
UNIQUE...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=489124817-30112000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=489124817-30112000>
<P><FONT size=2>Jeffery Stevenson<BR>Chief Database Geek<BR>Medical Present 
Value, Inc.<BR>Austin, TX</FONT> </P></SPAN></FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Koivu, Lisa 
  [mailto:lkoivu_at_qode.com]<BR><B>Sent:</B> Thursday, November 30, 2000 11:20 
  AM<BR><B>To:</B> Multiple recipients of list ORACLE-L<BR><B>Subject:</B> RE: 
  Primary keys vs. unique indexes<BR><BR></DIV></FONT>
  <P><FONT size=2>What?&nbsp; Yes you can.&nbsp; I have anyway. </FONT></P>
  <P><FONT size=2>Can you give me an example of when that would not work?</FONT> 
  </P>
  <P><FONT size=2>Lisa Rutland Koivu</FONT> <BR><FONT size=2>Oracle Database 
  Administrator</FONT> <BR><FONT size=2>Qode.com</FONT> <BR><FONT size=2>4850 
  North State Road 7</FONT> <BR><FONT size=2>Suite G104</FONT> <BR><FONT 
  size=2>Fort Lauderdale, FL&nbsp; 33319</FONT> </P>
  <P><FONT size=2>V: 954.484.3191, x174</FONT> <BR><FONT size=2>F: 954.484.2933 
  </FONT><BR><FONT size=2>C: 954.658.5849</FONT> <BR><FONT size=2><A 
  href="http://www.qode.com" target=_blank>http://www.qode.com</A></FONT> </P>
  <P><FONT size=2>"The information contained herein does not express the opinion 
  or position of Qode.com and cannot be attributed to or made binding upon 
  Qode.com."</FONT></P><BR>
  <P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: james 
  ellis [<A 
  href="mailto:jellis24_gso_at_yahoo.com">mailto:jellis24_gso_at_yahoo.com</A>]</FONT> 
  <BR><FONT size=2>Sent: Thursday, November 30, 2000 11:51 AM</FONT> <BR><FONT 
  size=2>To: Multiple recipients of list ORACLE-L</FONT> <BR><FONT 
  size=2>Subject: Re: Primary keys vs. unique indexes</FONT> </P><BR>
  <P><FONT size=2>The main difference is you can not reference an unique</FONT> 
  <BR><FONT size=2>index with a foreign key. </FONT><BR><FONT size=2>--- 
  cemail_at_sprintmail.com wrote:</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
  size=2>&gt; What is the difference between building a table and</FONT> 
  <BR><FONT size=2>&gt; including</FONT> <BR><FONT size=2>&gt; the primary key 
  versus building the table and then</FONT> <BR><FONT size=2>&gt; having 
  creating</FONT> <BR><FONT size=2>&gt; a unique index on the same keys?&nbsp; 
  When you create a</FONT> <BR><FONT size=2>&gt; table with</FONT> <BR><FONT 
  size=2>&gt; a primary key, doesn't Oracle store it as an index</FONT> 
  <BR><FONT size=2>&gt; anyway?</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
  size=2>&gt; -----</FONT> <BR><FONT size=2>&gt; Sent using MailStart.com 
  (</FONT> <BR><FONT size=2>&gt; <A href="http://MailStart.Com/welcome.html" 
  target=_blank>http://MailStart.Com/welcome.html</A> )</FONT> <BR><FONT 
  size=2>&gt; The FREE way to access your mailbox via any web</FONT> <BR><FONT 
  size=2>&gt; browser, anywhere!</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
  size=2>&gt; -- </FONT><BR><FONT size=2>&gt; Please see the official ORACLE-L 
  FAQ:</FONT> <BR><FONT size=2>&gt; <A href="http://www.orafaq.com" 
  target=_blank>http://www.orafaq.com</A></FONT> <BR><FONT size=2>&gt; -- 
  </FONT><BR><FONT size=2>&gt; Author: </FONT><BR><FONT size=2>&gt;&nbsp;&nbsp; 
  INET: cemail_at_sprintmail.com</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
  size=2>&gt; Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 
  538-5051&nbsp; FAX:</FONT> <BR><FONT size=2>&gt; (858) 538-5051</FONT> 
  <BR><FONT size=2>&gt; San Diego, 
  California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet</FONT> 
  <BR><FONT size=2>&gt; access / Mailing Lists</FONT> <BR><FONT 
  size=2>&gt;</FONT> <BR><FONT 
  size=2>--------------------------------------------------------------------</FONT> 
  <BR><FONT size=2>&gt; To REMOVE yourself from this mailing list, send 
  an</FONT> <BR><FONT size=2>&gt; E-Mail message</FONT> <BR><FONT size=2>&gt; 
  to: ListGuru_at_fatcity.com (note EXACT spelling of</FONT> <BR><FONT size=2>&gt; 
  'ListGuru') and in</FONT> <BR><FONT size=2>&gt; the message BODY, include a 
  line containing: UNSUB</FONT> <BR><FONT size=2>&gt; ORACLE-L</FONT> <BR><FONT 
  size=2>&gt; (or the name of mailing list you want to be removed</FONT> 
  <BR><FONT size=2>&gt; from).&nbsp; You may</FONT> <BR><FONT size=2>&gt; also 
  send the HELP command for other information</FONT> <BR><FONT size=2>&gt; (like 
  subscribing).</FONT> </P><BR>
  <P><FONT size=2>__________________________________________________</FONT> 
  <BR><FONT size=2>Do You Yahoo!?</FONT> <BR><FONT size=2>Yahoo! Shopping - 
  Thousands of Stores. Millions of Products.</FONT> <BR><FONT size=2><A 
  href="http://shopping.yahoo.com/" 
  target=_blank>http://shopping.yahoo.com/</A></FONT> <BR><FONT size=2>-- 
  </FONT><BR><FONT size=2>Please see the official ORACLE-L FAQ: <A 
  href="http://www.orafaq.com" target=_blank>http://www.orafaq.com</A></FONT> 
  <BR><FONT size=2>-- </FONT><BR><FONT size=2>Author: james ellis</FONT> 
  <BR><FONT size=2>&nbsp; INET: jellis24_gso_at_yahoo.com</FONT> </P>
  <P><FONT size=2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 
  538-5051&nbsp; FAX: (858) 538-5051</FONT> <BR><FONT size=2>San Diego, 
  California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access 
  / Mailing Lists</FONT> <BR><FONT 
  size=2>--------------------------------------------------------------------</FONT> 
  <BR><FONT size=2>To REMOVE yourself from this mailing list, send an E-Mail 
  message</FONT> <BR><FONT size=2>to: ListGuru_at_fatcity.com (note EXACT spelling 
  of 'ListGuru') and in</FONT> <BR><FONT size=2>the message BODY, include a line 
  containing: UNSUB ORACLE-L</FONT> <BR><FONT size=2>(or the name of mailing 
  list you want to be removed from).&nbsp; You may</FONT> <BR><FONT size=2>also 
Received on Thu Nov 30 2000 - 11:57:38 CST

Original text of this message

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