Soldato
- Joined
- 26 Aug 2012
- Posts
- 4,449
- Location
- North West
I am trying to create an application that allows users to create rules to generate alerts based on log values going into the Database.
The trigger created fine and is as follows:
This rule is meant to generate an alert message if a row with an application_name containing 'chrome' is inserted into the 'log_application' table.
However, every time i try to insert a row to test it works I get the following DB Error:
I know it is being able to match the word 'chrome' as if I insert an application name not containing 'chrome' there is no DB error caused by the trigger, so I know the issue is with the trigger, even though the error suggests otherwise.
Any help would be more appreciated.
The trigger created fine and is as follows:
Code:
CREATE TRIGGER `test_rule` AFTER INSERT ON `log_application`
FOR EACH ROW BEGIN
IF NEW.application_name LIKE chrome THEN
INSERT INTO log_alerts (alert_message) VALUES ('Chrome Installed');
END IF;
END
This rule is meant to generate an alert message if a row with an application_name containing 'chrome' is inserted into the 'log_application' table.
However, every time i try to insert a row to test it works I get the following DB Error:
I know it is being able to match the word 'chrome' as if I insert an application name not containing 'chrome' there is no DB error caused by the trigger, so I know the issue is with the trigger, even though the error suggests otherwise.
Any help would be more appreciated.
Last edited: