Solved

Column failed to delete

Posted on 2007-04-11
4
1,503 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 42

Assisted Solution

by:dqmq
dqmq earned 250 total points
ID: 18892383
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
ID: 18892415
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 32

Assisted Solution

by:awking00
awking00 earned 100 total points
ID: 18892448
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
ID: 18903721
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

691 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