Page 1 of 1

Clear DataSet Records without Server call (Primary Key is NULL)

Posted: Wed 06 Mar 2019 13:39
by dschuch
Hi,
i'm looking for a possibility to clear all the actuall loaded data in a PGQuery. (Only Records, Fields should stay)

Background: we have a rule, if a parameter is NULL than there is never a result.

So i want to implement for example before refresh: if param is null then dataset.ClearRecords to avoid the server call. (there are very many null requests). additionally its important to keep the dataset open.

so is there is a way to do this? PGQuery.TData.??? or override some function?

Thanks.

Re: Clear DataSet Records without Server call (Primary Key is NULL)

Posted: Thu 07 Mar 2019 15:10
by ViktorV
For local data update using TPgQuery component, you can use the LocalUpdate mode.
In the LocalUpdate mode data in dataset are changed locally but information about changes is not stored. So you cannot send the changes to the database.
For more information about these modes, please refer to PgDAC help: https://devart.com/unidac/docs/index.ht ... update.htm