Params confusion with Master\Detail

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sonjli
Posts: 1
Joined: Wed 03 Jul 2019 09:15

Params confusion with Master\Detail

Post by sonjli » Wed 03 Jul 2019 09:23

Hi,
I found this case:

UniQuery1 (select * from TABLE_MASTER JOIN ...)
UniQuery2 in detail with UniQuery1 (via MasterSource and "select * from TABLE_DETAIL WHERE ID_MASTER = :ID")

UniQuery2 have also a complex SQLRefresh which I use to refresh JOIN fields to avoid calcFields.
Example:
REfreshSQL.Text := 'SELECT * FROM TABLE_DETAIL JOIN... JOIN.. WHERE ID = :ID';

When I do
UniQuery2.INsert;
UniQuery2.FielbByName...
UniQuery2.POst;

UniQuery2.RefreshRecord; <-<-<- Error

In this case the is that the Params property is used for SQLRefresh, too, so SQLRefresh in insert is going to fail.

Hope to be clear.

Thanks
Eddy

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Params confusion with Master\Detail

Post by ViktorV » Thu 04 Jul 2019 11:33

In order to get a detailed answer, please compose a small sample demonstrating the specified behavior and send it to us using the contact form https://devart.com/company/contactform.html including scripts for creating and populating database objects. Also please specify the DBMS (and its version) you are working with.

Post Reply