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

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
louis
Expert Boarder
Expert Boarder
Posts: 107
Joined: 02.01.2009, 19:41

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

Post 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
louis
Expert Boarder
Expert Boarder
Posts: 107
Joined: 02.01.2009, 19:41

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

Post 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
delphi2pk
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 09.06.2009, 12:00

Post 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.
louis
Expert Boarder
Expert Boarder
Posts: 107
Joined: 02.01.2009, 19:41

Post by louis »

delphi2pk wrote:Before applying updateds disablecontrols from both queries and enable it again after comitting.
Thanks a lot, seems to work correctly.
Post Reply