Hi all,
I'm tring to create a unique constraint in enable novalidate mode. Here is the problem I'm getting.
I can create the constraint in disabled mode OK.
alter table my_table add constraint constraint_name UNIQUE
( col1,
col2,
col3,
col4,
col5,
col65
) disable
/
This creates OK, but when I then try and enable the constraint in novalidate mode I get the following...
alter table my_table ENABLE NOVALIDATE CONSTRAINT constraint_name
/
ERROR at line 1:
ORA-02299: cannot validate (schema.constraint_name) - duplicate keys found
I know there are duplicate keys in the table, which I why I am using the novalidate clause so that it does not validate current data only new DML.
I've read the Oracle documentation and it doesn't seem to rule out what I am trying to do, does anyone know where I aqm going wrong? If it's not possible to create this type of constraint is there a workaround so I can still do the same enforcement in a different way?
Thanks in advance,
Mike.
I'm tring to create a unique constraint in enable novalidate mode. Here is the problem I'm getting.
I can create the constraint in disabled mode OK.
alter table my_table add constraint constraint_name UNIQUE
( col1,
col2,
col3,
col4,
col5,
col65
) disable
/
This creates OK, but when I then try and enable the constraint in novalidate mode I get the following...
alter table my_table ENABLE NOVALIDATE CONSTRAINT constraint_name
/
ERROR at line 1:
ORA-02299: cannot validate (schema.constraint_name) - duplicate keys found
I know there are duplicate keys in the table, which I why I am using the novalidate clause so that it does not validate current data only new DML.
I've read the Oracle documentation and it doesn't seem to rule out what I am trying to do, does anyone know where I aqm going wrong? If it's not possible to create this type of constraint is there a workaround so I can still do the same enforcement in a different way?
Thanks in advance,
Mike.