------_=_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:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] > > 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. ********************************************************************* This e-mail message, and any files transmitted with it, are confidential and intended solely for the use of the addressee. If this message was not addressed to you, you have received it in error and any copying, distribution or other use of any part of it is strictly prohibited. Any views or opinions presented are solely those of the sender and do not necessarily represent those of the British Geological Survey. The security of e-mail communication cannot be guaranteed and the BGS accepts no liability for claims arising as a result of the use of this medium to transmit messages from or to the BGS. The BGS cannot accept any responsibility for viruses, so please 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> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Jacques Kilchoer [mailto:[EMAIL PROTECTED]<BR><B>Sent:</B> 26 March 2003 20:39<BR><B>To:</B> Multiple recipients of list ORACLE-L<BR><B>Subject:</B> RE: Syntax for foreign key<BR><BR></FONT></DIV> <P><FONT size=2>Indexes are only automatically created to enforce primary key and unique constraints.</FONT> <BR><FONT size=2>If you want an index to match the columns of a foreign key constraint, you will have to do it separately.</FONT> <BR><FONT size=2>P.S. If you already have a non-unique index on the PK <BR><SPAN class=175092009-27032003><FONT face=Arial color=#0000ff>[Peter Robson] </FONT></SPAN></FONT></P> <P><FONT size=2><SPAN class=175092009-27032003>Not possible - PK indexes are unique by definition.</SPAN></FONT></P> <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 unique constraint column(s), then Oracle will use that one to enforce the PK or unique constraint.</FONT></P> <P><FONT size=2>> -----Original Message-----</FONT> <BR><FONT size=2>> From: DENNIS WILLIAMS [<A href="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</FONT> <BR><FONT size=2>> </FONT><BR><FONT size=2>> I'm trying to add a foreign key constraint to a table, and specify the</FONT> <BR><FONT size=2>> tablespace and pctfree. Here is the syntax I'm using:</FONT> <BR><FONT size=2>> </FONT><BR><FONT size=2>> alter table jobproductoutrigger add (</FONT> <BR><FONT size=2>> constraint fk_jobprodu_currjobfa_currjobf foreign key (</FONT> <BR><FONT size=2>> jobnbr, sourcefiscalyear )</FONT> <BR><FONT size=2>> references currjobfact (jobnbr, sourcefiscalyear)</FONT> <BR><FONT size=2>> using index tablespace index73</FONT> <BR><FONT size=2>> pctfree 5)</FONT> <BR><FONT size=2>> / </FONT><BR><FONT size=2>> </FONT><BR><FONT size=2>> This produced the error:</FONT> <BR><FONT size=2>> </FONT><BR><FONT size=2>> ERROR at line 5:</FONT> <BR><FONT size=2>> ORA-00907: missing right parenthesis </FONT><BR><FONT size=2>> </FONT><BR><FONT size=2>> Can someone spot what I'm missing? This is Oracle 8.1.6.</FONT> </P></BLOCKQUOTE><FONT SIZE=3><BR> <BR> *********************************************************************<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> </BODY></HTML> ------_=_NextPart_001_01C2F442.264E9BE0-- -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Robson, Peter INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
