Is it correct or not?
alter table test
add constraint test_fk foreign key (prim_id)
references prim (prim_id)
using index
(create index i_test_prim_fk
on test(prim_id) tablespace index01)
on delete cascade
/
maybe using index not allowed here?
using index * ERROR at line 4: ORA-01735: invalid ALTER TABLE option
tried create fk expected error
The best way to check is to read the documentation.
ALTER TABLEhas the syntax:and then the
CREATE INDEXsyntax is here.The
using_indexclause specifies the following restrictions:No, your statement is not valid as:
ON DELETE CASCADEshould be beforeUSING INDEX.USING INDEXshould create a unique or primary key index.primand nottest.You can use two statements: