Search code examples
oracle-databaseddl

Add constraint PK using index tablespace


I am trying to run this code:

ALTER TABLE OPS.F4111 ADD CONSTRAINT F4111_PK PRIMARY KEY ( ILUKID ) USING INDEX 
OPS.F4111_0 
USING INDEX TABLESPACE OPS;

But getting an error: 01735. 00000 - "invalid ALTER TABLE option"

What is wrong with the code?

Thanks and Regards


Solution

  • You have USING INDEX twice. I think that you want:

    ALTER TABLE OPS.F4111 ADD CONSTRAINT F4111_PK PRIMARY KEY (ILUKID) 
    USING INDEX TABLESPACE OPS;