Skip to Main Content

SQL & PL/SQL

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!

Issue in creating Check Constraint

rvNov 26 2015 — edited Nov 26 2015

Hi Experts,

I have requirement to create a check constraint on a column(Number (6,2)) where in the max value is should be lower than 4000.

But the column already has the data more than 4000. Also i can't delete the data which is already there in the table.

I am just using an alter command

SQL> alter table test add constraint CC_A check(a < 4000);

Error is :

SQL Error: ORA-02293: cannot validate (CC_A) - check constraint violated

02293. 00000 - "cannot validate (%s.%s) - check constraint violated"

*Cause:    an alter table operation tried to validate a check constraint to

           populated table that had nocomplying values.

Can you suggest me the work around for it?

Regards,

RV

This post has been answered by Frank Kulash on Nov 26 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2015
Added on Nov 26 2015
2 comments
2,326 views