Topic: Join Questions
Hi All,
I'm having some problems with setting joins between tables. I believe it should be pretty basic and straight forward. But I'm getting myself confused (easy to do sometimes lol).
Here's what I would like to do. Please refer to the attached PDF file.
.
- Vessel should be the PARENT table
- Owner should be the CHILD table
- If I DELETE a record from the PARENT table, I would like to also delete the corresponding record from the CHILD table (Owner)
- Simple right?
- So logic tells me to join the Owner table (child) to the Vessel table (parent)
- However when I do that, it screws up all kinds of things in my application.
.
The way I have it in my attached pdf file seems to work the best for my application, however when I delete a VESSEL record it DOES NOT delete the OWNER record.
- I understand why my solution is not working but I can't seem to come up with how to make it work. I think, as I said that I'm confusing myself.
.
Right now I can delete a record from one of the other tables - MANUFACTURER, SUPPLIER...etc. However I am NOT able to delete an OWNER record without first deleting the VESSEL record. I don't understand this one because I don't believe I have the Cascade option set in any of the joins??
.
Note: in this application I will have - one Vessel and one Owner. The other tables, Manufacturers, Suppliers, Equipment...etc. will have many entries. I would like to leave the data in these tables even if the user deletes a Vessel and Owner and replaces them with a new Vessel and Owner.
.
Some thoughts about how PARENT/CHILD joins should be properly set up would be appreciated.
.
Thanks
Frank