Subject Re: [firebird-support] Re: Updating a stored procedure
Author Gaurav Sood
> > I have a set of cascade delete procedures which delete all records
> > associated with clients if you delete the profile of a client from a
> > People table within the database. The cascade delete will totally
> > remove all details of all clients and their relevant transcripts
> from
> > the database if you 'delete from People'.
>
> You have just reinvented the wheel.
>
> ALTER TABLE CLIENTS ADD CONSTRAINT FK_CLIENTS_1 FOREIGN KEY
> (PEOPLEID) REFERENCES PEOPLE (ID) ON UPDATE CASCADE ON DELETE CASCADE;

Hi Adam

So according to this constraint, if I understand correctly, the table
Clients which has a foreign key PEOPLEID from table People (with
primary key ID), shall automatically cascade delete (or update as a
delete).

Therefore, I would have to add this constraint to all tables which use
the PEOPLE (ID) key as a foreign key.

Thanks

Gaurav


I think i've learnt my Generator lesson now.