Subject Re: [ib-support] Re: preventing orphaned rows
Author Duilio Foschi
David,

>Have you thought of inserting a detail row from within an AFTER INSERT
>trigger on the master table?

>Alternatively, insert both the master row
>and the first detail row using a stored procedure that first does the
>master, then the detail.

cool, but both solutions look difficult to implement with IBO, that I am
using.

The problem with these controls is that you lose the atomic nature of the
master-detail record: the header and every single row start lives of their
own <g>

>Similarly, you could use a BEFORE DELETE trigger on the detail table
>to make sure at least one detail row remains for the master row.

there is already a foreign key in the detail table that prevents the master
to be deleted first.

If I apply the control you suggest, it seems that nobody will be able to
delete a whole (master-detail) record any more...

>Come va il progetto?

spero di consegnare gran parte della nuova versione gia' lunedi'.

Ciao

Duilio