Bug: Invalid DDL for compressed primary keys

BWendling

Member³
Hi,

I create my primary keys as follows:
1. Create a compressed (and local) index.
2. Create a primary key with the same name.

Oracle will then use the index created in step 1. This way, I can make full use of Oracle features (local, compress) which is not supported in the alter table statement.

Currently, generated DDL is:

alter table BRANCH
add constraint BRANCH_PK primary key (ASOFDATE, BRANCHCODE);

Instead, the DDL generator must generate compressed indexes (and in a later PLSD version local indexes) in two steps as outlined above.
 
Just in case what to do:

The correct DDL would be (you may omit the "local" keyword until PLSD supports it officially):

CREATE UNIQUE INDEX BRANCH_PK ON BRANCH (ASOFDATE, BRANCHCODE) LOCAL COMPRESS;

ALTER TABLE BRANCH ADD CONSTRAINT BRANCH_PK PRIMARY KEY (ASOFDATE, BRANCHCODE);
 
Back
Top