posted 14 years ago
You must use 'FOR EACH ROW' clause - without this a trigger is a 'statement level' trigger, not 'record level' trigger,
and it fires only once on each statement, not on each row - for example INSERT INTO talbe SELECT * FROM table2 could insert hundred or thousands rows,
but the trigger is fired only once, and it is not related to any particular row - you cannot check inserted values etc.
Instruction: UPDATE TBL SET COLUMN2 = 'A' WHERE COLUMN2 IS NULL; updates records in a whole table, not only in changed record.
If you want to check only values of this particular new 'inserted' row, you must use a BEFORE trigger, not AFTER, and inside the tigger use a ':NEW pseudorecord
to check and change inserted values.
Try this: