Column failed to delete

I got htis error message when I tried to delete this column but unsure how to narrow effect the deletion of this column successfully. Below is the error message I got:

SQL> --Removing VDS_KEY from Table VA_VULNERABILITIES table  

ALTER TABLE VA_VULNERABILITIES DROP (VDS_KEY)
;SQL> SQL>   2  
ALTER TABLE VA_VULNERABILITIES DROP (VDS_KEY)
                                     *
ERROR at line 1:
ORA-12991: column is referenced in a multi-column constraint

Please advice.
jbfannieAsked:
Who is Participating?
 
imarediaCommented:
You are attempting to drop this column which is referenced by some other constraints, so to drop this column you can use either of the two ways below:
   1. Drop all the constraints referencing this column and then try to drop this column.  OR
   2. Use CASCADE CONSTRAINTS in your statement.

To find out which constraints are being referenced to this column use the query given by awking00.
0
 
dqmqCommented:
Look at your foreign key constraints for VA_VULNERABILITIES.  Odds are, one of them includes VDS_KEY.  Drop that constraint first, then you can drop the column.
0
 
dqmqCommented:
If not a foreign key, the VDS_KEY could be part of the primary key or a unique constraint. However, dropping either of those has far more serious implications.
0
 
awking00Commented:
To find the constraint -
select constraint_name from user_cons_columns
where table_name = 'VA_VULNERABILITIES'
and column_name = 'VDS_KEY';
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.