?
Solved

Column failed to delete

Posted on 2007-04-11
4
Medium Priority
?
1,528 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 1000 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 1000 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 400 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 600 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.
Suggested Courses

770 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