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

  • From: "Jacques Kilchoer" <Jacques.Kilchoer@xxxxxxxxx>
  • To: <mccdba1@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 20 Jan 2005 15:06:57 -0800

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

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


Other related posts: