However, if customers or suppliers can have multiple accounts, you are
going to need an intermediate table, as suggested by Neil.
Scratch that. If accounts can have multiple owners you'll need an
intermediate table.
---(end of broadcast)---
On Tue, 2005-11-22 at 16:24 +0100, Joost Kraaijeveld wrote:
> Hi,
>
> Is there a way to create a foreign key to 2 tables: e.g. a bankaccount
> table that has a column "owner", that must point to a record in either
> the customer or the supplier table?
No. What you need is an owner table that cust
I've never seen anything like that. I'm sure it's conceivable that you
could write a weird trigger for it, but you have to consider
maintainability, and what your queries are going to look like. I
haven't seen your datamodel, but it would seem that you could accomplish
what you're looking for
O Joost Kraaijeveld έγραψε στις Nov 22, 2005 :
> Hi,
>
> Is there a way to create a foreign key to 2 tables: e.g. a bankaccount
> table that has a column "owner", that must point to a record in either
> the customer or the supplier table?
While there are techniques to accomplish this,
i see a p
As far as I'm aware, not without using an intermediatary table (id,
cust_id, supplier_id) . Otherwise, how would you know which table the
foreign key was referencing?
That said, an intermediatary table isn't a very clean solution; What
problem are you trying to solve, exactly?
Kind Regards,
Neil
Hi,
Is there a way to create a foreign key to 2 tables: e.g. a bankaccount
table that has a column "owner", that must point to a record in either
the customer or the supplier table?
TIA
--
Groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277