The Query Builder allows you to write database triggers, provided you have the necessary credentials. Write / on an empty line after your create trigger command, as shown in the example below. If you are ISP hosted, your privileges will be limited.
Example of a database trigger that prevents updates on table dept #
CREATE TRIGGER prevent_updates_on_dept BEFORE UPDATE ON dept
FOR EACH ROW
BEGIN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Update failed...';
END;
/
When the user tries to update a row in table dept with this trigger enabled, the trigger prevents the update and returns error “Update failed…” as shown in the screenshot below. You can change this error message to anything you like.