on 2015 Apr 24 2:33 AM
Hi, I want to use the before update trigger in data into data which have change for example
When using row level triggers (and BEFORE triggers are always row level triggers), you do not use UPDATE statements to modify the contents of the according row but use SET statements to modify the individual columns of the current row - cf. that sample from the docs:
CREATE TRIGGER emp_upper_postal_code BEFORE UPDATE OF PostalCode ON Employees REFERENCING NEW AS new_emp FOR EACH ROW WHEN ( ISNUMERIC( new_emp.PostalCode ) = 0 ) BEGIN -- Ensure postal code is uppercase (employee might be -- in Canada where postal codes contain letters) SET new_emp.PostalCode = UPPER(new_emp.PostalCode) END;
So in your case it might work to use something like (I don't claim to understand the calculations):
... set new_shipper_line.amount = isnull(new_shipper_line.user_9,0) * isnull(new_shipper_line.user_10,0); set new_shipper_line.sys_all_amt = isnull(new_shipper_line.user_9,0) * ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.