Subject RE: [IBO] CachedUpdates does not update the new value
Author Jason Wharton
Please send me a sample application demonstrating your problem and if there
is a bug I'll fix it.
If it is a bug in your application then we all can learn something from it.

Jason Wharton

> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of kokok_kokok
> Sent: Monday, May 15, 2006 9:52 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] CachedUpdates does not update the new value
>
>
>
> 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.