If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
One-to-many relationship need entry on the many side?
Would it violate referential integrity to, for test reasons, input entries
into the "one" side without at least one entry on the "many" side? Thanks! |
#2
|
|||
|
|||
One-to-many relationship need entry on the many side?
On Tue, 9 Sep 2008 16:05:01 -0700, Pamela
wrote: Would it violate referential integrity to, for test reasons, input entries into the "one" side without at least one entry on the "many" side? Thanks! No. You can have a chicken that hasn't laid any eggs, but you can't have an egg unless you have a chicken to lay it. In fact, the situation you describe will ALWAYS exist at some point - you've got to enter the parent record first, before you're even able to create child records. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
One-to-many relationship need entry on the many side?
Hi Pamela
No, not at all. It happens all the time. Consider a new customer who hasn't yet made any purchases. In fact, you MUST create the record on the one side before you can create any related records on the many side. -- Good Luck :-) Graham Mandeno [Access MVP] Auckland, New Zealand "Pamela" wrote in message ... Would it violate referential integrity to, for test reasons, input entries into the "one" side without at least one entry on the "many" side? Thanks! |
#4
|
|||
|
|||
One-to-many relationship need entry on the many side?
Thank you - that was my logic but I have been running into some problems that
I think stem from my relationships and wanted to make sure that that scenario wasn't the root. "John W. Vinson" wrote: On Tue, 9 Sep 2008 16:05:01 -0700, Pamela wrote: Would it violate referential integrity to, for test reasons, input entries into the "one" side without at least one entry on the "many" side? Thanks! No. You can have a chicken that hasn't laid any eggs, but you can't have an egg unless you have a chicken to lay it. In fact, the situation you describe will ALWAYS exist at some point - you've got to enter the parent record first, before you're even able to create child records. -- John W. Vinson [MVP] |
#5
|
|||
|
|||
One-to-many relationship need entry on the many side?
Thank you - that was my logic but I have been running into some problems that
I think stem from my relationships and wanted to make sure that that scenario wasn't the root. "Graham Mandeno" wrote: Hi Pamela No, not at all. It happens all the time. Consider a new customer who hasn't yet made any purchases. In fact, you MUST create the record on the one side before you can create any related records on the many side. -- Good Luck :-) Graham Mandeno [Access MVP] Auckland, New Zealand "Pamela" wrote in message ... Would it violate referential integrity to, for test reasons, input entries into the "one" side without at least one entry on the "many" side? Thanks! |
#6
|
|||
|
|||
One-to-many relationship need entry on the many side?
On Tue, 09 Sep 2008 17:45:10 -0600, John W. Vinson
wrote: On Tue, 9 Sep 2008 16:05:01 -0700, Pamela wrote: Would it violate referential integrity to, for test reasons, input entries into the "one" side without at least one entry on the "many" side? Thanks! No. You can have a chicken that hasn't laid any eggs, but you can't have an egg unless you have a chicken to lay it. In fact, the situation you describe will ALWAYS exist at some point - you've got to enter the parent record first, before you're even able to create child records. Nice explanation John. But I'll also add that you have to decide whether the foreign key in the child table is required. Many people think that a foreign key with a null value violates referential integrity. It doesn't. You can use the Required property to control whether the field must have a value. Referential Integrity will ensure that if it does have a value, that the value is valid (exists in the related table). So, you can have an egg who doesn't know who its mommy is, and still meet referential integrity. It's up to you to specify Required if you don't want this sad situation. Armen Stein Microsoft Access MVP www.JStreetTech.com |
Thread Tools | |
Display Modes | |
|
|