ORA-00001 unique constraint violated

ORA-00001 unique constraint (constraint_name) violated

Oracle PL/SQL error message: ORA-00001 unique constraint (constraint_name) violated.

Cause:

An UPDATE or INSERT statement attempted to insert a duplicate key.

Solution:

Check and change your SQL statement to avoid the duplicate values.

Remove the unique constraint using the command drop constraint.

Example:

CREATE TABLE TEST(
	TEST_ID NUMBER NOT NULL ENABLE, 
	TEST_NAME VARCHAR2(250) NOT NULL ENABLE
	CONSTRAINT UK1_TEST UNIQUE (TEST_ID, TEST_NAME) ENABLE
);

INSERT INTO TEST (TEST_ID, TEST_NAME) VALUES (1, 'ABC');
INSERT INTO TEST (TEST_ID, TEST_NAME) VALUES (1, 'ABC');

table TEST created.
1 rows inserted.
SQL Error: ORA-00001: unique constraint (UK1_TEST) violated