Query ChangeLog

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 3
Joined: Thu 10 May 2012 10:21

Query ChangeLog

Post by [email protected] » 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

[email protected]
Posts: 3
Joined: Thu 10 May 2012 10:21

Re: Query ChangeLog

Post by [email protected] » 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?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Query ChangeLog

Post by AlexP » Fri 11 May 2012 11:27

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;

Post Reply