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!

ORA-14196 Specified index cannot be used to enforce the constraint - is that a bug?

user9228758May 21 2017 — edited Jun 2 2017

Hello Community,

I wanted to use an index in a constraint when I encountered an error message:

ORA-14196 Specified index cannot be used to enforce the constraint

This sample created the error

CREATE UNIQUE INDEX MID ON MATABLE (MADATE DESC);

ALTER TABLE MATABLE ADD CONSTRAINT CPK UNIQUE (MADATE) USING INDEX MID;

That one worked:

CREATE UNIQUE INDEX MID ON MATABLE (MADATE ASC);

ALTER TABLE MATABLE ADD CONSTRAINT CPK UNIQUE (MADATE) USING INDEX MID;

ASC works, DESC does not

SQL Error: ORA-14196: Specified index cannot be used to enforce the constraint.

14196. 00000 -  "Specified index cannot be used to enforce the constraint."

*Cause:    The index specified to enforce the constraint is unsuitable

           for the purpose.

*Action:   Specify a suitable index or allow one to be built automatically.

This post has been answered by Gaz in Oz on May 21 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2017
Added on May 21 2017
3 comments
3,544 views