MySQL Forums
Forum List  »  Triggers

Re: Calculation from time stamps through to amount due
Posted by: Peter Brawley
Date: September 03, 2016 07:23PM

> set new amount_due = (elapsed * rate)'
> throws an error.

And we mayn't know what that error message says!?

> how to "check for elapsed" before doing the next calculation

A Trigger can't do a raw Select, so set user variables to the values you are tracking, and after the Trigger has run, select the user vars to see what they contain.

The Trigger has no control over column values delivered to it, so your code has to handle the possibility of Nulls and outlandish values.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Calculation from time stamps through to amount due
910
September 03, 2016 07:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.