Subject | Re: [firebird-support] An Interesting Update Trigger Behavior |
---|---|
Author | Mark Rotteveel |
Post date | 2009-08-17T06:51:40Z |
That should do the trick.
Mark
Kurt Federspiel wrote:
Mark Rotteveel
Mark
Kurt Federspiel wrote:
> Hi, Mark.--
>
> Apologies for the delay, but I got trapped by RL.
>
> I think you are right that the trigger is the issue because it tests two TIMESTAMP fields to see which is greater.
>
> BEGIN
> UPDATE new_data set A1=NEW.A1, A2=NEW.A2, DateTime_Stamp=NEW.DateTime_Stamp
> WHERE MAC=NEW.MAC AND DateTime_Stamp<=NEW.DateTime_Stamp;
> end
>
> Since NULL is a lack of data, I assume that would fail. I haven't put in a test for NULL yet. Would a simple OR suffice?? For Example:
>
> BEGIN
> UPDATE new_data set A1=NEW.A1, A2=NEW.A2, Temp=NEW.Temp, DateTime_Stamp=NEW.DateTime_Stamp
> WHERE MAC=NEW.MAC
> AND (DateTime_Stamp<=NEW.DateTime_Stamp OR DateTime_Stamp IS NULL);
> end
Mark Rotteveel