First page Back Continue Last page Image

Example: A Trigger Used to Standardize to Upper Case

DELIMITER //

 

CREATE TRIGGER vendors_before_update

BEFORE UPDATE ON vendors

FOR EACH ROW

BEGIN

SET NEW.vendor_state = UPPER(NEW.vendor_state);

END//

UPDATE vendors

SET vendor_state = 'wi'

WHERE vendor_id = 1

An example of a statement that would activate the trigger