Page 1 of 1

Need help on Master / Detail

Posted: Sun 17 Apr 2016 08:40
by Atys
Hi,

I have 2 UniQuerys, the first is the Master one, the key for the detail is the field 'S_ID' and i've several rows
in the master with the same S_ID's.
The problem is, that the detail won't do anything if i scroll in the master between rows with the same S_ID.
Does not do a First;, nor clearing the EOF flag of the Detail, nothing.
Is this normal or do i miss a flag/setting anywhere?
Do i have to do it manually?

Thanks

UNIDAC 6.2.10 / MsSQL / Delphi 10S

Re: Need help on Master / Detail

Posted: Mon 18 Apr 2016 15:13
by MaximG
We can't see a reason to update the detail table in case when a linked field is not updated in the master table. Therefore such an option is absent in UniDAC and has to be implemented manually by the developer.

Re: Need help on Master / Detail

Posted: Mon 18 Apr 2016 18:29
by Atys
The linked field is updated since the master dataset moves to the next record.
It's just having the same value after the scroll and UniDAC unliterally decides, based on its value, that
the master key did not changed.

And yes, there are 3 good reasons to implement this:

1. There is no event, nor in the master, neither in the detail where i could "implement" a .First; for both
scenarios (new value / same value in master dataset).

2. You can't use UniDAC database components to pass master/detail sets to any 3rd party components
like a report generator, without having it's source code and hack around.

3. BDE components like TQuery resets the detail dataset regardless of the value of the key field. So
UniDAC is not compatible in this manner, and results in unexpected behavior.

Re: Need help on Master / Detail

Posted: Wed 20 Apr 2016 10:33
by MaximG
The detail table is not updated when the key in the master table is not modified in order to increase UniDAC performance. Since if the key field is not modified, then data in the detail table is not modified, and re-execution of an identical detail-query will lead to unwanted increase of Reduced traffic and DBMS workload. We will consider the possibility to implement this functionality in future. You can leave your suggestions at our UserVoice page (http://devart.uservoice.com/forums/1046 ... 909-common), and if there are many votes for your suggestion, we will implement it.

Re: Need help on Master / Detail

Posted: Wed 20 Apr 2016 10:50
by Atys
Thank you Maxim,

I agree that refetching the detail would be a waste of resources however resetting the cursor to the first record would not cost too much and the compatibility would be granted to other products and prior practices.
I also won't mind if there was a flag to control this behavior.