I need your assitance in the following requirement.
create table RC_COL_DETAILS
COL_ID NUMBER(5) not null,
COL_NAME VARCHAR2(30) not null,
DURATION_KEY NUMBER(1) default 0 not nul
-- ALLOWED , as col "DURATION_KEY" value is 0.
1. Insert into RC_COL_DETAILS values(1,'TOLL_VALUE',0);
-- ALLOWED only for single row, col "DURATION_KEY" with value 1.
2. Insert into RC_COL_DETAILS values(2,'BILL_DUR',1);
-- NOT ALLOWED , as only one row can have "DURATION_KEY" value as 1.
3. Insert into RC_COL_DETAILS values(3,'CALL_DUR',1);
How can I accompalish this using CHECK constraints? I mean how do I enforce constraints so that only one row can have the "DURATION_KEY" value as 1.
I don't want to write trigger for this.
Thanks & Regards,
Anand Kumar Ojha