ORA-02431: cannot disable constraint

ORA-02431: cannot disable constraint

Oracle PL/SQL error message: ORA-02431: cannot disable constraint.

Cause:

The named constraint does not exist for this table.

Solution:

Check that a constraint exists before trying to disable it.




Example:

ALTER TABLE test
DISABLE CONSTRAINT constraint_name;

Output:

ORA-02431: cannot disable constraint

Check constraint

SELECT OWNER, CONSTRAINT_NAME, STATUS
FROM user_constraints
WHERE table_name = 'TEST';