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.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Multiple-Parents

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-04, 13:14
Hananiel Hananiel is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
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.

Hananiel
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 06:04
marp marp is offline
Registered User
 
Join Date: Jan 2004
Location: Romania - Bucharest
Posts: 50
Re: Multiple-Parents

I 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

Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On