Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Strange behaviour while creating composite key with "no validate"

JameDec 7 2011 — edited Dec 7 2011
Hi All,

It was very strange to me. Can you please tell me where i am doing mistake.

I want to create composite key for the combination "INT_ID" and "STO_ID" columns in table "act_ord". since this table already have more duplicate entrieS for this combination I decide to use "enable novalidate" to skip validation for the already existing duplicate records while creating constraints. But I am getting the following error "ORA-02260: table can have only one primary key" while executing the below statement 1.1. If i create constraint for 1 column with novalidate option means, its working fine.
1.1 Not working:- Giving error ORA-02260: table can have only one primary key
ALTER TABLE ACT_ORD ADD CONSTRAINT PK_INT_ORD
 PRIMARY KEY   (INT_ID,STO_ID) enable novalidate 
1.2 Working without any error:
ALTER TABLE SPL_VAS.ACT_ORDER ADD CONSTRAINT PK_INT_STO_ORD
 PRIMARY KEY   (INT_ID) enable novalidate
Is there any limitation to use "enable novalidate" with composite primary key creation?

Please do the needful and shoot your suggestions.

Regards,
Jame
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2012
Added on Dec 7 2011
2 comments
210 views