Re: [GENERAL] constraint/rule/trigger - insert into table X where not in table Y

2010-07-14 Thread Alban Hertroys
On 14 Jul 2010, at 18:13, David Kerr wrote: > Howdy, > > I'm trying to think of the best way to handle this situation. > > I've got 2 tables, X and Y > > Table X has a field foo varchar(20) > Table Y has a field bar varchar(20) > > I want to enforce, that if table X.foo = 'dave' then you can'

[GENERAL] constraint/rule/trigger - insert into table X where not in table Y

2010-07-14 Thread David Kerr
Howdy, I'm trying to think of the best way to handle this situation. I've got 2 tables, X and Y Table X has a field foo varchar(20) Table Y has a field bar varchar(20) I want to enforce, that if table X.foo = 'dave' then you can't insert (or update) Y.bar = 'dave' I know this is ideally done