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: Non-primary key constraints in Oracle

Re: Non-primary key constraints in Oracle

From: Joel Garry <joelga_at_pebble.org>
Date: Wed, 24 Jun 1998 22:08:15 GMT
Message-Id: <slrn6p2u87.94i.joelga@pebble.org>


On Tue, 23 Jun 1998 18:50:26 +0200, Rainer Scheel <rainer.scheel_at_sno.drs1.x400.sni.de> wrote:
>A foreign key constraint must reference a primary/unique key in the referenced
>table.
>Otherwise, you get
>ORA-02270: no matching unique or primary key for this column-list
>"Model" is not unique in table "Car", so in fact you cannot create a foreign key.
>(The reason is performance, I believe:
>You could create an index on "model" in table "car", but the RDBMS might not be
>handle the duplicates that efficient.)

The docs keep telling me this, but I keep getting 2270 with just a unique key. Is it supposed to be "unique AND primary key" or am I missing something else? No problems with primary. 7.3.4 on Solaris 2.6.

jg
--
These opinions are my own and not necessarily those of Information Quest

or Pebble In The Sky                     http://www.informationquest.com

http://ourworld.compuserve.com/homepages/joel_garry jgarry@nospameiq.com
"See your DBA?"  I AM the @#%*& DBA!     Remove nospam to reply.  Sorry.
Received on Wed Jun 24 1998 - 17:08:15 CDT

Original text of this message

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