Home » RDBMS Server » Server Administration » Index treated as primary key
Index treated as primary key [message #52604] Wed, 31 July 2002 09:27 Go to next message
Eddy Confer
Messages: 17
Registered: January 2002
Junior Member
I am running the following code to create a table. When I subsequently try to drop the index XIE1DOC_FORMAT I get this message(ORA-02429: cannot drop index used for enforcement of unique/primary key. Why is ORacle treating the index as a primary key? I do the same thing on other tables without the same results.

CREATE TABLE DOC_FORMAT (
doc_format_id RAW(16) NOT NULL,
description VARCHAR2(255) NOT NULL,
server_process_mask INTEGER DEFAULT 0 NOT NULL
CHECK (server_process_mask >= 0),
server_process_info INTEGER DEFAULT 0 NOT NULL
CHECK (server_process_info >= 0),
client_process_mask INTEGER DEFAULT 0 NOT NULL
CHECK (client_process_mask >= 0),
client_process_info INTEGER DEFAULT 0 NOT NULL
CHECK (client_process_info >= 0),
creatable INTEGER DEFAULT 0 NOT NULL
CHECK (creatable >= 0),
document_extension VARCHAR2(16) NOT NULL,
document_mime VARCHAR2(64) NOT NULL,
PRIMARY KEY (doc_format_id)
)
STORAGE (
INITIAL 8K
NEXT 8K
PCTINCREASE 0
)
;

CREATE INDEX XIE1DOC_FORMAT ON DOC_FORMAT
(
doc_format_id ASC,
creatable ASC
);
Re: Index treated as primary key [message #52606 is a reply to message #52604] Wed, 31 July 2002 09:36 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
That is almost certainly not the script which was run to create the table & PK in the state is is now. select object_name, object_type, created, last_ddl_time
from user_objects where object_name in ('DOC_FORMAT', 'XIE1DOC_FORMAT');

In 8i, a PK does not need a dedicated unique index to implement the PK. If the index XIE1DOC_FORMAT was already there and you issued an "alter table..." to add the PK, then it would use that existing index.
Previous Topic: Single or multiple database?
Next Topic: Table Design Confution(URGENT)
Goto Forum:
  


Current Time: Thu Sep 19 15:00:54 CDT 2024