In a stored procedure a timestamp variable has been set (via a cursor select) to null.
When using that variable to update a timestamp column of another table, the updated value resolves as
0000-00-00 00:04:00 instead of null.
It does not vary when many records are processed through the SP, always just 4 minutes.
Have not been able to predicted when we will get a null (as desired) or get a 0000-00-00 00:04:00 (not)
No date math occurring nearby.
update x_tbls.aircraft_custody
set end_ts = c_custody_end_ts,
source_name = 'XXXX', last_alter_ts = w_last_alter_ts where
acft_serno = w_acft_serno and action_ts =
(select max(action_ts) from x_tbls.aircraft_custody
where acft_serno = w_acft_serno and
action_ts < w_action_ts);
Forums: