Subject Re: [IBO] [newbie] Delete related Records?
Author Dmitry Beloshistov
Hello, Joaquim!
You wrote to <IBObjects@yahoogroups.com> on Thu, 23 Jan 2003 16:32:40 -0000:


JMj> Suppose that I have 2 tables. These are related with a Foreign Key
JMj> on field: FIELD_RELATED.

JMj> If I delete a record on a TABLE_1, I would like that a record(s)
JMj> would be deleted also on TABLE_2, where: TABLE_1.FIELD_RELATED =
JMj> TABLE_2.FIELD_RELATED .

JMj> What is the best approach to do this?
JMj> 1) Use database triggers,
JMj> 2) Use the TIB_Query.DeleteSQL property,
JMj> 3) Define it on the Foreign Key,
JMj> 4) Another ...?

Using foreign keys is best (as I know) solution in this situation...

WBR, Dmitry Beloshistov AKA [-=BDS=-]
e-mail: torin@...