ORA-00001 unique constraint & ORA-02443 Cannot drop constraint - nonexistent constraint

ORA-00001 unique constraint  & ORA-02443 Cannot drop constraint  - nonexistent constraint


Issue 

Dropped Primary key constraint BSNL_FIBER_TIP_USED_ORDER_PK using TOAD GUI

But while inserting a row in the table even after the constraint is dropped the following error thrown

 ORA-00001: unique constraint (FMS_ADMIN.BSNL_FIBER_TIP_USED_ORDER_PK)  violated

 Solution

     1. First tried to drop the constraint using SQL Command promt.

ALTER TABLE BSNL_FIBER_TIP_USED_ORDER DROP CONSTRAINT BSNL_FIBER_TIP_USED_ORDER_PK;

 It has thrown the following error

ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 10
ORA-02443: Cannot drop constraint  - nonexistent constraint


2.       Checked DBA_CONSTRAINTS

 select * from dba_constraints where constraint_name='BSNL_FIBER_TIP_USED_ORDER_PK';

 No constraint available

 

3.     Then checked the DBA_INDEXES because when a primary key constraint is added to any table it automatically creates one unique index with the same name as the primary key constraint name

 SELECT * FROM DBA_INDEXES WHERE TABLE_NAME='BSNL_FIBER_TIP_USED_ORDER';

OR  directly check with index name

SELECT * FROM DBA_INDEXES 

WHERE INDEX_NAME='BSNL_FIBER_TIP_USED_ORDER_PK';

 It is observed that the unique index is available as shown below 

 

4.       Then dropped the index

 DROP INDEX BSNL_FIBER_TIP_USED_ORDER_PK;

 Index got dropped.

 

5.       Now able to insert a row.

 

 

 

 

 


Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post