Friday, March 23, 2012

Multiple-Parents

Can I have two different parents for the same child table in a dataset. The columns for which the relationships exist are the same:

For ex:

TABLE1

ID DATA

TABLE2

ID DATA

TABLE3

ID TABLETYPE TABLEID DATA

When TableTYPE is table1, TABLEID should be assigned ID from TAble1
and when TableTYPE is table2, TABLEID should be assigned ID from TABLE2

Is that possible. How can i get this behavior. The whole purpose of relationships is not constraint checking as much as assigning right ID values in a dataset.

HananielI think you should create a "dummy" parent table, let's call it "D", having 1-1 relationships to Table1 and Table2 and then you should link Table3 to table "D"

Something like that:

Table D: - has a field D_Id, of "autonumber" type

Table1 has a 1-1 relationship with table D on D_Id

Table2 has a 1-1 relationship with table D on D_Id

D has a 1-M relationship with Table3, on D_Id as primary key (Table3 is the "Slave" table)

Maro

Originally posted by Hananiel
Can I have two different parents for the same child table in a dataset. The columns for which the relationships exist are the same:

For ex:

TABLE1

ID DATA

TABLE2

ID DATA

TABLE3

ID TABLETYPE TABLEID DATA

When TableTYPE is table1, TABLEID should be assigned ID from TAble1
and when TableTYPE is table2, TABLEID should be assigned ID from TABLE2

Is that possible. How can i get this behavior. The whole purpose of relationships is not constraint checking as much as assigning right ID values in a dataset.

Hananiel

No comments:

Post a Comment