473,396 Members | 1,892 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.

Clarify "Enforce Relationship"

....please.

I've found other posts that explain the Cascade options, but the
Enforce relationships option still is foggy to me.

As to "enforcing relationship for ... UPDATEs"(with cascade NOT
checked), then I'm guessing that an update to that key field that would
normally cascade will instead produce some sort of constraint violation
error?

And if Cascade updates is checked, but I try to update a key in a table
on the many side of a relationship, then this won't cascade "up" to the
one side will it? Would it just produce a constraint violation?

With enforce relationship for insert:

Does this mean if I try to insert into the many side of a relationship
that I can't insert unless the keys that are related already exist in
the other table?

How does this apply to a one-to-one relationship? If I can't insert
into one table because the key isn't in the other one, how do I insert
the record with that key into both tables simultaniously? I'm sure I'm
wrong about some of my guesses here.

Thanks in advance.

Nov 13 '05 #1
1 2611
Shumaker,
Suppose Invoices and items on the invoice, or line items. With
relationships enforced you could not delete an invoice without first
deleting it's line items. If the primary key of invoices is something that
a user types like an invoice number, then you can't change the invoice
number in invoices without doing something about that same invoice number
listed in line items. Without cascade update enabled this normally means
that an invoice number can't be changed without disabling "enforce
relationships" temporarily, then changing the invoice number in related
records in line items first, then changing it in invoice, then re-enabling
"enforce relationships".

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS
<sh******@cs.fsu.edu> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
...please.

I've found other posts that explain the Cascade options, but the
Enforce relationships option still is foggy to me.

As to "enforcing relationship for ... UPDATEs"(with cascade NOT
checked), then I'm guessing that an update to that key field that would
normally cascade will instead produce some sort of constraint violation
error?

And if Cascade updates is checked, but I try to update a key in a table
on the many side of a relationship, then this won't cascade "up" to the
one side will it? Would it just produce a constraint violation?

With enforce relationship for insert:

Does this mean if I try to insert into the many side of a relationship
that I can't insert unless the keys that are related already exist in
the other table?

How does this apply to a one-to-one relationship? If I can't insert
into one table because the key isn't in the other one, how do I insert
the record with that key into both tables simultaniously? I'm sure I'm
wrong about some of my guesses here.

Thanks in advance.

Nov 13 '05 #2

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

Similar topics

2
by: Sukkel | last post by:
When I define relations in the Backend of my Database, everything works fine. I get these funny lines (with 1 and "OO") between the fields of the different table that indicate a one to many...
43
by: Zeng | last post by:
It's so messy w/o the "friend" relationship. Does anyone know why it was not supported in C#. It's almost about as bad as it doesn't support the inheritance hierarchy and method reference...
2
by: Mehdi | last post by:
Hi, I need to pass an URL via a hidden value as follow: <input type="hidden" id="Test" runat="Server"> and on Page_Load I assign a value to this hidden input as follow: Test.Value =...
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: 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
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
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.