Page 1 of 1

Query ChangeLog

Posted: Thu 10 May 2012 12:17
Hi all.
I'm changing in my application all my ClientDataSets with OraQuerys (with CahcedUpdate enabled), but have found that can't replace the ClientDataSet.ChangeCount function, usefull to understand if there are some changes pending or not.

There is a possibility to know if any record in my OraQuery is changed?

Many thanks
Manuel

Re: Query ChangeLog

Posted: Thu 10 May 2012 13:18
Find UpdatesPending, that show if there is any changes in data, that for now do its works.

But there is the possibility to have the change log?

Re: Query ChangeLog

Posted: Fri 11 May 2012 11:27
by AlexP
Hello,

For retrieving the modified data after the Post method call and before the ApplyUpdates call, you can use the following code

Code: Select all

  if OraQuery1.UpdatesPending then
  begin
    OraQuery1.First;
    j:= 0;
    While not OraQuery1.Eof do
    begin
      if OraQuery1.UpdateStatus = usUnmodified then
        for i := 0 to OraQuery1.FieldCount - 1 do
          if OraQuery1.Fields[i].OldValue <> OraQuery1.Fields[i].NewValue then
            ShowMessage(Format('In the #%d string the %s field was modified. The old value was %s , the new value is %s',[j, OraQuery1.Fields[i].FieldName, VarToStr(OraQuery1.Fields[i].OldValue),VarToStr(OraQuery1.Fields[i].NewValue)]));
      OraQuery1.Next;
      inc(j);
    end;
  end;