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: [Q] create foreign key problem???

RE: [Q] create foreign key problem???

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Thu, 20 Jan 2005 15:06:57 -0800
Message-ID: <B5C5F99D765BB744B54FFDF35F60262109F87C08@irvmbxw02>


Oracle does not automatically create or require an index for enforcement of a foreign key constraint; it creates (or requires a pre-existing) index for primary key or unique constraints. If you want an index on the same columns as the columns in the foreign key constraint, you will need to create it separately using the CREATE INDEX command. The USING INDEX part of the constraint clause is only valid for primary key or unique constraints. -----Original Message-----
dba1 mcc

I tried to create foreign ley constraint with index using following command:

alter table spinfo add constraint fk11 foreign key (cbnum) references primary_info using index tablespace idx_space

I got "ORA-01735: invalid ALTER TABLE option" on "using index tablespace idx_space". How to use "using index space" with foreign key?

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jan 20 2005 - 18:10:43 CST

Original text of this message

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