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

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dschuch
Posts: 75
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

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

Post by dschuch » Wed 06 Mar 2019 13:39

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.

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

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

Post by ViktorV » Thu 07 Mar 2019 15:10

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

Post Reply