Partial DataSet update

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ChristianL
Posts: 1
Joined: Tue 03 Jun 2008 14:18

Partial DataSet update

Post by ChristianL » Tue 03 Jun 2008 14:23

Hi,

We have a query object that has been populated by Execute. Now another system adds an row into the database and notifies our software. We do know the primary key of the new row. Is there any way to add that row to the local dataset with reloading the entire query by Execute?

We don't even have to read all the field values from the database, because we already know them. We just need that row added so we can display it in our grid...

Regards,
Christian

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 04 Jun 2008 11:41

You can use LocalUpdate property of TOraQuery. For example:

Code: Select all

  OraQuery.LocalUpdate := True;
  OraQuery.Append;
  OraQuery.FieldByName('ID').AsInteger := 1;
  OraQuery.Post;
  OraQuery.LocalUpdate := False;
  OraQuery.RefreshRecord; // get other fields from the database
When LocalUpdate is True no queries are executed to update the dataset.

Post Reply