Page 1 of 1

[FB2.1]Master-Detail and correct usage of Foreign Key

Posted: 02.11.2010, 12:45
by louis
Hallo,
I have this scenario:
Master-Detail

Master have CachedUpdates = False
Detail Have CachedUpdate = True

On Master.BeforePost I do Detail.ApplyUpdates and works Ok.

I tried to understand usage of Foreign key and I add a Foreign Key on table Detail that refer on primary key of Master.

But, now when I try:Detail.ApplyUpdates, FB Raise exception because the key on Master is not present!

What is the correct usage of Foreign Key on ZeosLib?

Thanks

Re: [FB2.1]Master-Detail and correct usage of Foreign Key

Posted: 03.11.2010, 19:25
by louis
louis wrote:What is the correct usage of Foreign Key on ZeosLib?
I used correctly but the is a bug on Master/Detail that losts detail on applyUpdates, see http://zeosbugs.firmos.at/view.php?id=185

Posted: 11.11.2010, 09:51
by delphi2pk
Dear louis,

Here is a simple solution.

Before applying updateds disablecontrols from both queries and enable it again after comitting.

Give it a try.

Posted: 19.11.2010, 19:19
by louis
delphi2pk wrote:Before applying updateds disablecontrols from both queries and enable it again after comitting.
Thanks a lot, seems to work correctly.