473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to drop primary key referenced to other foreign key?

Hello
I want to Drop a primary key Referenced to other foriegn key.
I try the following method
---------------------
alter table Stock drop constraint SYS_C005460;
---------------------
But it give me The following Message.

ORA-02273: this unique/primary key is referenced by some foreign keys.

How to drop it PLZ gime the Best Answer.
Lookin forword,Thank you in Advance.
Nov 22 '10 #1
2 27082
Oralloy
988 Expert 512MB
You'll have to find all foreign key references to the primary key of your table, and drop them or modify them.

I think you'll find a table in the catalog with all key references identified in it, if you are having difficulty finding the tables that you need to change.

Regardless, why do you need to drop the constraint? Are you trying to perform a change, which will violate or destroy your data integrity? Make sure before you go down the path of forcing this issue. That's what Oracle's error message is trying to tell you.
Nov 22 '10 #2
alter table Stock drop constraint SYS_C005460 CASCADE;
Nov 22 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: T.S.Negi | last post by:
Hi there, I have created a hash table. After using it, somehow the primary key constraint of this hash table still exist in database. Which cause error. When I delete this constraint with...
3
by: heroe | last post by:
Hello *, i write you with an urgent problem. I would like to create forign keys to datetime field, but it doesn't seem to work. I get Can't create table '.\sampleDB\student_module.frm' (errno:...
10
by: D. Dante Lorenso | last post by:
I'd like to run a clean up command on my tables to eliminate rows that I'm no longer using in the database. I want to do something like this: DELETE FROM tablename WHERE...
13
by: Tibor | last post by:
I am using PostgreSQL 7.4.1 (only through psql) I know, that the command ALTER TABLE OFFICES DROP PRIMARY KEY (CITY); and its foreign key equivalent: ALTER TABLE SALESREPS DROP CONSTRAINT
1
by: Lyandar | last post by:
I have a SQL question i was hoping someone had a quick fix for. We have a database for technitions to go in and view their paysheets with is pulled off the server but in the URL it will show their...
0
by: Truevision .Net | last post by:
Hi, I have a problem with drag and drop functionality when it comes to dropping pictures from sources like for example internet explorer and the webbrowser control. Dragging and dropping from...
3
by: lucoin | last post by:
I have a global schema include the relations customer, order, orderline, salesperson, and product. I fragment the salesperson into salesperson_MEL and salesperson_SYD, the salesperson in different...
1
jamesd0142
by: jamesd0142 | last post by:
select 'ALTER TABLE ' + primary_table + ' drop CONSTRAINT ' + primary_key_name + ' FOREIGN KEY (' + foreign_column_1 + ')' from sysfkeys order by foreign_table How can I change this code to...
6
by: Chandan Kr Sah | last post by:
How to drop primary key constraint from a column of table ? Actually I got so many example for this, but in that we require the primary key name also. But I dont have the primary key name.So if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.