Subject CachedUpdates does not update the new value
Author kokok_kokok
I use TIBOQuery + ClientDatasets. CachedUpdates= true to emulate the
UpdateMode=upWhereAll of TProvider and to use all fields in the WHERE
clausule.

When I modify a field, TIBOQuery does not use the new value in the
generated SQL statement, it uses the old value. I can see it in the
SQL monitor Window.

I have been studyng the IBO code and the problem is in the procedure
TIBODataSet.AssignParamsValues, exactly when tmpParam := FindParam(
tmpP.BestFieldName );

BestFieldName deletes the "OLD." prefix and then it points to the new
value, in the sql "SET" clausule, instead of the sql WHERE clausule.

For example, IBO generates the following statement:

UPDATE CUSTOMER SET NAME=:NAME WHERE NAME=:OLD.NAME

In the form, I modify the name box, for example for JOHN to ED.

In the monitor I see

UPDATE CUSTOMER SET NAME=:NAME WHERE NAME=:OLD.NAME
:NAME='ED'
:OLD.NAME='ED'


The new value is never used because FindParam( tmpP.BestFieldName )
points the :NAME instead of OLD.NAME.


Does somebody the same problem? which is the best way to avoid it?

Thank you.