473,804 Members | 3,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to avoid Reference problems

Hi,
I have some tables which have references between them.

If i delete the reors in the child tables , since it references the
column of the parent , i get error msg in my front end (quite
natural).

do u tell me how to delete the child table records with out affecting
the relation ships or can recreate the relations with out affecting my
data & structure and the constraints.

With thanks
Raghu
Jul 20 '05 #1
2 1605
Raghu,

You can disable the constraint, delete the record(s) and then re-enable the
constraint.

J.R.
Largo SQL Tools
The Finest Collection of SQL Tools Available
http://www.largosqltools.com

"Raghuraman " <ra************ @rediffmail.com > wrote in message
news:66******** *************** ***@posting.goo gle.com...
Hi,
I have some tables which have references between them.

If i delete the reors in the child tables , since it references the
column of the parent , i get error msg in my front end (quite
natural).

do u tell me how to delete the child table records with out affecting
the relation ships or can recreate the relations with out affecting my
data & structure and the constraints.

With thanks
Raghu

Jul 20 '05 #2
On 21 Nov 2003 06:09:54 -0800, ra************@ rediffmail.com
(Raghuraman) wrote:
Hi,
I have some tables which have references between them.

If i delete the reors in the child tables , since it references the
column of the parent , i get error msg in my front end (quite
natural).

do u tell me how to delete the child table records with out affecting
the relation ships or can recreate the relations with out affecting my
data & structure and the constraints.

With thanks
Raghu

You can usually delete child rows without problems. It's deleting a
parent that has children that is usually protected. One way is to
specify delete cascade when you create the reference. In this case
deleting the parent will delete all children.

For clarity, imagine two tables

OrderHeader
OrderNumber (PK),
Customer)

and

OrderDetail
(LineNumber,
OrderNumber (FK)
ProductCode)

Every row in OrderDetail has the key from OrderHeader as a foreign
key. You can delete the child rows from OrderDetail, but if you
attempt to delete from OrderHeader you will be stopped if there are
rows in OrderDetail, for that order. Specifying on delete cascade
means that the delete of OrderHeader also deletes all related rows in
OrderDetail.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1984
by: Jake Lloyd | last post by:
In "A Note on Security In PHP" (partly in reference to a security flaw that exists or recently did exist in phpBB) at http://nl3.php.net/security-note.php The PHP Group makes this claim: "Every remote exploit can be avoided with very careful input validation." This is very reassuring, if it is true, and it gives much to be said in favor of implementing PHP in applications that accept remote user input. But is it true? One rarely sees an...
6
2716
by: Nels Olsen | last post by:
Our company is rewriting our product in .NET. The old product is in PowerBuilder, which is heavy on Hungarian notation. We are approaching the time where we have to finalize naming conventions for everything publicly exposed in our API There are two camps -- the Hungarian camp and the "Readable English" camp. I am in the latter. Like Microsoft's official recommendations for .NET, I have seen the light. Readability is what matters when...
19
2901
by: Charles Law | last post by:
Take a solution with a project hierarchy along the lines of an n-tier system, so that we have a data layer, business layer and presentation layer. The presentation layer is coupled to the business layer, and the business layer is coupled to the data layer. So far so good. Suppose the data layer raises an event, and it passes Me (the sender) as an object, and e (MyEventArgs, a descendent of EventArgs) to the layer above (the business...
5
2272
by: StephQ | last post by:
This is from a thread that I posted on another forum some days ago. I didn't get any response, so I'm proposing it in this ng in hope of better luck :) The standard explanation is that pointer to functions are hard to inline for the compiler, and so you won't be able to avoid function call overhead. This is an important aspect when you are calling a function very frequently for evaluation reason: think of the problem of performing...
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10319
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10303
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.