Subject | RE: [firebird-support] Re: Help with a DELETE command |
---|---|
Author | Alan McDonald |
Post date | 2004-12-05T23:05:48Z |
> > Delete Trigger to say something like:very obvous....
> >
> > delete from parent
> > where f_child_id = old.f_id
> > and f_foo = 1
>
> Do you mean this?
>
> delete from Child where Child.F_ID = OLD.F_ID;
>
> Also, it may not be obvious yet but there are MANY Child records to a
> single Parent record.
but no
DELETE FROM CHILD WHERE CHILD.F_ID = OLD.ID;
where this statement is in the before delete trigger of the parent table
and OLD.ID refers, then, to the parent PK. F_ID is the child table foreign
key.
Alan