Solved

Column failed to delete

Posted on 2007-04-11
4
1,408 Views
Last Modified: 2013-12-18
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.
0
Comment
Question by:jbfannie
  • 2
4 Comments
 
LVL 42

Assisted Solution

by:dqmq
dqmq earned 250 total points
Comment Utility
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
 
LVL 42

Assisted Solution

by:dqmq
dqmq earned 250 total points
Comment Utility
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
 
LVL 31

Assisted Solution

by:awking00
awking00 earned 100 total points
Comment Utility
To find the constraint -
select constraint_name from user_cons_columns
where table_name = 'VA_VULNERABILITIES'
and column_name = 'VDS_KEY';
0
 
LVL 3

Accepted Solution

by:
imaredia earned 150 total points
Comment Utility
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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now