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!

Conditional Constraint

malhiAug 26 2011 — edited Aug 30 2011
Following is the layout of my table, Status Column can have 1,2,3....6 . My requirement is that CNIC column can not be duplicate if status = 1, this can be duplicate for other status types.
This table has about 0.5 Million Records.
CREATE TABLE TARIQ_CORE.pensioner
(
  claim_no        VARCHAR2(25),
  cnic            VARCHAR2(13),
  status          NUMBER(1),
  name            VARCHAR2(35),
  pension_amount  NUMBER(5)
);

ALTER TABLE TARIQ_CORE.pensioner ADD (
  CONSTRAINT pensioner_PK
  PRIMARY KEY
  (claim_no));
How can i manage this.
This post has been answered by Pierre Forstmann on Aug 26 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 27 2011
Added on Aug 26 2011
19 comments
345 views