Subject | Re: Masterlinks demo - does not work ? |
---|---|
Author | SLSolutions@aol.com |
Post date | 2000-12-28T22:36:26Z |
Wes,
Thanks much. Have done what you suggested and it works fine.
Joe
Thanks much. Have done what you suggested and it works fine.
Joe
--- In IBObjects@egroups.com, wes@l... wrote:
> Joe,
>
> >Being new to Interbase and IBO, I may simply not understand but I
can
> >find no way to accomplish what I need.
>
> >When I deleted the master (Employee) record, since the tables were
> >linked master/detail, all I had to do was
> >With PayControlTable Do
> >Begin
> > First;
> > While Not Eof Do
> > Delete;
> >End;
> >and all pay control records for the employee were deleted.
>
> That's the way it HAS to be done with many "desktop" databases. One
of
> the many advantages of client server databases is this sort of thing
> can be done by the database SERVER, instead of by the client
program.
>
> In my documents for IB6, I find the relevant information/techniques
in
> the file DataDef.pdf under "Defining Integrity Constraints." (Pg
100).
>
> What you'll want to do is, when defining your PayControlTable,
specify
> a foreign key that references the Employee table and for which you
> specify ON DELETE CASCADE.
>
> When an employee record is deleted, Interbase itself will then see
to
> it that the appropriate PayControlTable records get deleted, too.
>
> -----------------------------
>
> Wes Peterson
> LexCraft Data Services
> 916.944.4870
> http://www.lexcraft.com
> wes@l...