Controlling user access > 19.1. CREATE TRIGGER Syntax
>
> That is your MySQL reference section.
Yeah, I found that, printed it out, and got thoroughly confused before
I posted my initial question.
> I do not know the syntax for an "ignore" or "cancel" update.
> Worst case scenario, you compare the required field, and
> set all other fields to old or new values accordingly.
You mean, instead of checking before the update and trying to cancel
the changes, check after the update and reverse the changes if
necessary? Something like:
CREATE TRIGGER FY2007 AFTER UPDATE ON ITPLAN.REQ
FOR EACH ROW BEGIN
IF REQ.INIT_DATE < '2006-09-01' THEN
IF REQ.FIELD1 <> OLD.FIELD1 THEN SET REQ.FIELD1 =
OLD.FIELD1;
IF REQ.FIELD2 <> OLD.FIELD2 THEN SET REQ.FIELD2 =
OLD.FIELD2;
IF REQ.FIELD3 <> OLD.FIELD3 THEN SET REQ.FIELD3 =
OLD.FIELD3;
...
ENDIF
END
I'm probably writing that code incorrectly, but as you've no doubt
noticed, you could put everything I know about MySQL into a gnat's
bellybutton. |