ORA-00001: unique constraint (string.string) violated
Cause: An UPDATE or INSERT statement attempted to insert a duplicate key. For Trusted Oracle configured in DBMS MAC mode, you may see this message if a duplicate entry exists at a different level.
Action: Either remove the unique restriction or do not insert the key.
The options to resolve this Oracle error are:
- Drop the unique constraint
- Change the constraint to allow duplicate values
- Modify your SQL so that a duplicate value is not created
select distinct table_name
from all_indexes
where index_name = 'CONSTRAINT_NAME';

In our example (see picture above), our constraint name would be SYS_C002459 and we would execute the following SQL:
select distinct table_nameThis would return the name of the table whose unique constraint we violated.
from all_indexes
where index_name = 'SYS_C002459';
No comments:
Post a Comment