Subject | Master-Master Insert |
---|---|
Author | ehandbury |
Post date | 2002-03-07T05:38:51Z |
Hello,
I have two tables:
AGENT - which stores all info specific to the real estate agent
PERSON - stores all personal info of everyone
Since the AGENT is also a PERSON, I have to add to both tables when
I want to add an AGENT.
What's the best approach for this:
1) Having the AGENT as the master, and PERSON as the detail?
2) Having the AGENT as the KEYSOURCE for the PERSON Dataset?
3) Not having any relationship between the two datasets?
And how is an insert done properly here? What I do is when the user
presses the '+' button, the AGENT->AfterInsert event contains a
PERSON->Insert() which sets the proper keylinks in the PERSON
dataset. However, I still haven't got it right, so I think there must
be a easy way here.
It's more complicated than normal because I have to code-up my own
InsertSQL,EditSQL,DeleteSQL since the AGENT select is a JOIN of the
two tables (AGENT & PERSON).
Thanks in advance. Eric.
I have two tables:
AGENT - which stores all info specific to the real estate agent
PERSON - stores all personal info of everyone
Since the AGENT is also a PERSON, I have to add to both tables when
I want to add an AGENT.
What's the best approach for this:
1) Having the AGENT as the master, and PERSON as the detail?
2) Having the AGENT as the KEYSOURCE for the PERSON Dataset?
3) Not having any relationship between the two datasets?
And how is an insert done properly here? What I do is when the user
presses the '+' button, the AGENT->AfterInsert event contains a
PERSON->Insert() which sets the proper keylinks in the PERSON
dataset. However, I still haven't got it right, so I think there must
be a easy way here.
It's more complicated than normal because I have to code-up my own
InsertSQL,EditSQL,DeleteSQL since the AGENT select is a JOIN of the
two tables (AGENT & PERSON).
Thanks in advance. Eric.