MySQL Forums
Forum List  »  Triggers

Trigger
Posted by: Tobias Dinse
Date: April 27, 2011 08:06AM

Hi,

I tried to create an trigger that put incomming Traps from the Program "snmptt" to different tables with an if command.

Here is my Code:

DELIMITER $$
DROP TRIGGER /*!50033 IF EXISTS */ `trap_verteilung`$$
CREATE TRIGGER trap_verteilung BEFORE INSERT on snmptt.snmptt
FOR EACH ROW
BEGIN
IF new.community = 'public' then
insert into snmp.test
SET id = new.id,
eventname = new.eventname,
eventid = new.eventid,
trapoid = new.trapoid,
enterprise = new.enterprise,
community = new.community,
hostname = new.hostname,
agentip = new.agentip,
category = new.category,
severity = new.severity,
uptime = new.uptime,
traptime = new.traptime,
formatline = new.formatline,
trapread = new.trapread;
ENDIF;
DELIMITER ;

If the Community of an new incomming Trap is "public" it have to be in snmp.test. Anyone has an Idea why this Trigger dont work?

Thanks and regards

Tobias



Edited 1 time(s). Last edit at 05/03/2011 05:46AM by Tobias Dinse.

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger
2523
April 27, 2011 08:06AM
914
April 27, 2011 09:35AM
1042
April 28, 2011 06:46AM
874
May 03, 2011 04:12AM
881
April 28, 2011 02:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.