Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Syntax for foreign key
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_01C2F442.264E9BE0
Content-Type: text/plain; charset="iso-8859-1"
-----Original Message-----
Sent: 26 March 2003 20:39
To: Multiple recipients of list ORACLE-L
Indexes are only automatically created to enforce primary key and unique
constraints.
If you want an index to match the columns of a foreign key constraint, you
will have to do it separately.
P.S. If you already have a non-unique index on the PK
[Peter Robson]
Not possible - PK indexes are unique by definition.
peter
or unique constraint column(s), then Oracle will use that one to enforce the PK or unique constraint.
> -----Original Message-----
> From: DENNIS WILLIAMS [ mailto:DWILLIAMS_at_LIFETOUCH.COM
<mailto:DWILLIAMS_at_LIFETOUCH.COM> ]
>
> I'm trying to add a foreign key constraint to a table, and specify the
> tablespace and pctfree. Here is the syntax I'm using:
>
> alter table jobproductoutrigger add (
> constraint fk_jobprodu_currjobfa_currjobf foreign key (
> jobnbr, sourcefiscalyear )
> references currjobfact (jobnbr, sourcefiscalyear)
> using index tablespace index73
> pctfree 5)
> /
>
> This produced the error:
>
> ERROR at line 5:
> ORA-00907: missing right parenthesis
>
> Can someone spot what I'm missing? This is Oracle 8.1.6.
scan all attachments. http://www.bgs.ac.uk *********************************************************************
------_=_NextPart_001_01C2F442.264E9BE0
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: Syntax for foreign key</TITLE> <META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD> <BODY>
<P><FONT size=2><SPAN class=175092009-27032003>peter</SPAN></FONT></P> <P><FONT size=2><SPAN class=175092009-27032003></SPAN></FONT> </P> <P><FONT size=2><SPAN class=175092009-27032003></SPAN></FONT> </P> <P><FONT size=2><SPAN class=175092009-27032003> </SPAN>or uniqueconstraint column(s), then Oracle will use that one to enforce the PK or unique constraint.</FONT></P>
*********************************************************************<BR> This e-mail message, and any files transmitted with it, are<BR> confidential and intended solely for the use of the addressee. If<BR> this message was not addressed to you, you have received it in error<BR> and any copying, distribution or other use of any part of it is<BR> strictly prohibited. Any views or opinions presented are solely those<BR> of the sender and do not necessarily represent those of the British<BR> Geological Survey. The security of e-mail communication cannot be<BR> guaranteed and the BGS accepts no liability for claims arising as a<BR> result of the use of this medium to transmit messages from or to the<BR> BGS. The BGS cannot accept any responsibility for viruses, so please<BR> scan all attachments. http://www.bgs.ac.uk<BR> *********************************************************************<BR></FONT>
------_=_NextPart_001_01C2F442.264E9BE0--
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Robson, Peter INET: pgro_at_bgs.ac.uk Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- 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).Received on Thu Mar 27 2003 - 03:18:35 CST