If TSQLQuery.UpdateMode is set to upWhereAll or upWhereChanged then record is not updated if OldValue is null
Original Reporter info from Mantis: lacak @lacak.sk
-
Reporter name: LacaK
Original Reporter info from Mantis: lacak @lacak.sk
- Reporter name: LacaK
Description:
If UpdateSQL (or DeleteSQL) is automaticaly generated (in ApplyRecUpdate), then the form of background query string is :
update &LtPos;FTableName> set &LtPos;sql_set> where &LtPos;sql_where>;
&LtPos;sql_where> has form:
&LtPos;fieldname> =: OLD_&LtPos;fieldname> for all fields
But when OldValue is null then final form of query string is like:
&LtPos;fieldname> = null
According to SQL spec. this expression never evaluates to True, so we can not update record, which originaly contained some null value.
This can be fixed with "little trick" in ApplyRecUpdate method.
I attached some draft ...