ORA-00001: unique constraint (string.string) violated

This forum is for Database developer ( PostgreSQL, MySQL, SQL Server, Oracle etc...) and database Administrator
alpeshviranik
Posts: 81
Joined: Thu Jul 17, 2014 4:58 pm
Contact:

ORA-00001: unique constraint (string.string) violated

Postby alpeshviranik » Thu Aug 14, 2014 6:04 pm

what is ORA-00001: unique constraint (string.string) violated error? how to solve it.


Guest

Re: ORA-00001: unique constraint (string.string) violated

Postby Guest » Thu Aug 14, 2014 6:17 pm

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.


This error means that an attempt has been made to insert a record with a duplicate (unique) key. This error will also be generated if an existing record is updated to generate a duplicate (unique) key. Typically this is a duplicate primary key, but it need not be the primary key.

Only one of the following will be appropriate:
1) Remove the unique restriction.
2) Change the restriction to allow duplicate keys. An index could be changed to be a non-unique index, but remember that the primary key must always be unique.
3) Do not insert the duplicate key.

4) Usually this error indicates an application error or error on the part of the user.
5) The error gives the name of the constraint that has been violated, but not the name of the table. To identify the table and find out all the relevant information about the index it is normally easiest to use Oracle Schema Manager - the name of the constraint given in the error will match with the name of the corresponding index. Alternately, to identify the name of the table use:

select tablename from allindexes where indexname=' ';


this view ('allindexes') also contains some other information about the index, such as its uniqueness.
and to identify the files that together constitute the index:
select * from allindcolumns where index_name=' ';


Return to “PostgreSQL, MySQL, SQL Server, SQL,PL/SQL, TeraData Developer and DataBase Administration”

Who is online

Users browsing this forum: No registered users and 1 guest