Page 1 of 1

Partial DataSet update

Posted: Tue 03 Jun 2008 14:23
by ChristianL
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

Posted: Wed 04 Jun 2008 11:41
by Plash
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.