Helen Bailey Books

Grab Life By the Health Taking Tips

Hit enter after type your search item
Helen Bailey Books

Grab Life By the Health Taking Tips

ORA-02430: cannot enable constraint (UNIQUE_CON2) – no such constraint [closed]

You are Reading..

ORA-02430: cannot enable constraint (UNIQUE_CON2) – no such constraint [closed]

I’ve created a table transaction_line which is described as follows:

SQL> desc transaction_line
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 TRANSACTION_ID                                     NUMBER(20)
 TRANSACTION_LINE_ID                                NUMBER(20)
 LOCATION_ID                                        NUMBER(20)
 DEPARTMENT_ID                                      NUMBER(20)
 ITEM_ID                                            NUMBER(20)
 AMOUNT                                             NUMBER(8,2)
 COST                                               NUMBER(8,2)
 UNITS                                              NUMBER(5)

Now the thing is, on transaction_id and transaction_line_id I’ve applied unique constraint which is described as follows:

SQL> alter table transaction_line add constraint unique_cons2 unique(transaction_id, transaction_line_id);
    
Table altered.

And here’s the constraints on it:

SQL> select constraint_type, constraint_name, status from user_constraints where table_name=upper(‘transaction_line’);

C CONSTRAINT_NAME                STATUS
- ------------------------------ --------
U UNIQUE_CONS2                   DISABLED
R SYS_C007198                    ENABLED
R SYS_C007200                    ENABLED

Although I’ve disabled it further on but now I want to drop that constraint completely which I tried:

SQL> alter table transaction_line drop constraint UNIQUE_CON2;
alter table transaction_line drop constraint UNIQUE_CON2
                                             *
ERROR at line 1:
ORA-02443: Cannot drop constraint  - nonexistent constraint

But it’s showing error there. Can somebody tell me how can I completely drop that constraint there? Thank you so much!