S
Sheldon Slade
Setup: I'm building a database to track enrollments in
software classes. Prospective students (or the companies
who want to train them) buy vouchers; each voucher is good
for one class. So I have a Vouchers table containing an
OwnerID field.
OwnerID corresponds to one of the following:
1. A record in the Companies table if the voucher belongs
to a company
2. A record in the Students table if the voucher belongs
to an individual
Difficulty: I'd like to enforce referential integrity and
use Cascade Update/Delete, but there will only be one
owner of a particular voucher (in either Commpanies or
Students). Is there a way to create an either/or enforced
relationship?
(Afterthought: In posting this, I'm thinking I might have
gone about it all wrong. I'm wondering now if I should
just create a "None" company and put all my individuals in
there, then trap the CompanyID whenever I'm trying to show
the "owner" of the voucher. Thoughts?)
TIA,
Sheldon
software classes. Prospective students (or the companies
who want to train them) buy vouchers; each voucher is good
for one class. So I have a Vouchers table containing an
OwnerID field.
OwnerID corresponds to one of the following:
1. A record in the Companies table if the voucher belongs
to a company
2. A record in the Students table if the voucher belongs
to an individual
Difficulty: I'd like to enforce referential integrity and
use Cascade Update/Delete, but there will only be one
owner of a particular voucher (in either Commpanies or
Students). Is there a way to create an either/or enforced
relationship?
(Afterthought: In posting this, I'm thinking I might have
gone about it all wrong. I'm wondering now if I should
just create a "None" company and put all my individuals in
there, then trap the CompanyID whenever I'm trying to show
the "owner" of the voucher. Thoughts?)
TIA,
Sheldon