Page 1 of 1

Params confusion with Master\Detail

Posted: Wed 03 Jul 2019 09:23
by sonjli
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

Re: Params confusion with Master\Detail

Posted: Thu 04 Jul 2019 11:33
by ViktorV
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.