Constraints: 1 Child -> Multiple Parents

Constraints: 1 Child -> Multiple Parents

 

  

Hi,

Is it possible to define a constraint (on one table) that relates to
multiple other tables?

Example: One Accounts table where each Account is a child record of either a
Customer, Prospect, or Other record which are all separate table but share a
universal Oracle sequence for their Primary Key.

The account table key would consist of two columns.
e.g.
account_parent_seqno
account_parent_type

The constraint would be in terms of these two columns and the 3 parent
tables.

Presumably, the only way to do this is manually via a trigger but I am
interested to find out if there are any other ways (maybe something like
Materialised Views could handle this)?

Thanks,
Peter Verhoeven

MS Sql Server LazyDBA home page