Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple parents..?

Status
Not open for further replies.

sKrEwBaLL

Programmer
Joined
Aug 20, 2001
Messages
8
Location
GB
Hi

This is probably a silly question, maybe I am clutching at straws here, but it is possible to have multiple parents in a relationship. For example, is it possible to set up a foreign key which looks at table_x OR table_y for the same column.

We have DB2 7.1.1 for Z/OS.

Cheers

Neil
 
Neil,

not tried it but is it possible to set the relationship using a view, which would contain both table_x or table_y.

Cheers
Greg
 
Hi Greg,

Just tried that, but I get sqlcode -157, "Only a table name can be specified in a foreign key clause".

Thanks for trying!

Neil
 
Neil,

In which case maybe you need to consider denormalising your database to achieve this?

Cheers
Greg
 
Managed to find a workaround which involves adding a column to the parent table and adding a predicate to the existing views.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top