|Subject||Re: [IBO] Calculating data|
Hi Marcin, If I have 2 fields to update, is it better to have one larger Trigger or 2 smaller ones.
Secondly I have to update a single table field called "Quotahours". This field is the product of FTE2 * 690
Below is my code but is doesn't work.
SET TERM ^ ;
CREATE TRIGGER QUOTA FOR STAFF ACTIVE
AFTER INSERT OR UPDATE OR DELETE POSITION 1
DECLARE VARIABLE STAFF_CODE INTEGER;
IF (INSERTING OR DELETING OR (UPDATING AND (NEW.QUOTAHOURS IS DISTINCT FROM OLD.QUOTAHOURS)))
IF (DELETING)THEN STAFF_CODE = OLD.STAFF_CODE;
ELSE STAFF_CODE = NEW.STAFF_CODE;
SET QUOTAHOURS = (690 * FTE2)
WHERE STAFF_CODE = :STAFF_CODE;
SET TERM ; ^
Can you see why my code doesn't work?