473,396 Members | 1,917 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 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 1590
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.google.c om...
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
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...
6
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...
19
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...
5
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.