Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat pk.on.nonunique.index.sql
- drop table nonunique purge;
- create table nonunique ( i number );
- create index pk_i on nonunique ( i );
- alter table nonunique add constraint pk_i primary key ( i );
- @ sel.pkdemo.md.sql NONUNIQUE
- SQL> @ pk.on.nonunique.index.sql
- Table dropped.
- Table created.
- Index created.
- Table altered.
- TABLE_NAME COLUMN_NAME NUL
- ------------------------------ ------------------------------ ---
- NONUNIQUE I N
- TABLE_NAME INDEX_NAME UNIQUENESS STATUS
- ------------------------------ ------------------------------ --------------------------- ------------------------
- NONUNIQUE PK_I NONUNIQUE VALID
- TABLE_NAME INDEX_NAME COLUMN_NAME
- ------------------------------ ------------------------------ ------------------------------
- NONUNIQUE PK_I I
- CONSTRAINT_NAME CON STATUS VALIDATED
- ------------------------------ --- ------------------------ ---------------------------------------
- PK_I P ENABLED VALIDATED
- You can create a primary key constraint on top of a nonunique index.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement