Refresh grid after update via cursor

Grisa

Member²
The circumstances is that I have an Orcale dataset based on a procedure which results a cursor. The resultset is displayed in a grid. After I run a single row update I would like to refresh the resultset of the grid, but don't know how to.
Setting UpdatingTable and executing RefreshRecord() didn't make any action.

Can you help me, with a very-very fast solution? The queried tables are big, so re-query the data is not a solution.

Thx, G
 
If you want to refresh the result set, call TOracleDataSet.Refresh.

If you want to refresh a single record, a RefreshRecord should work if the RowId is correct and if the UpdatingTable is correct. If this does not work, set TOracleDataSet.Debug to True and verify which query is executed for the refresh:

Code:
MyDataSet.Debug := True;
try
  MyDataSet.RefreshRecord;
finally
  MyDataSet.Debug := False;
end;
 
Thanks for the answer, it worked if I have included the AllFields as Refresh option.

Now I have a bit different problem.
Based on the active record I update the same table with a procedure in a package. So the update affects more than 1 record in the grid. To refresh the whole dataset is quite costy, so would be great if I could concentrate on the changed records and refresh only them.
Is it possible somehow?

Thanks,
Grisa
 
You will have to navigate through the dataset to find the affected records and call RefreshRecord. Use TOracleDataSet.DisableControls and EnableControls to make this visually smooth.
 
Back
Top