MySQL Forums
Forum List  »  Triggers

INSERT and DELETE on trigger
Posted by: André Carvalho
Date: March 29, 2005 06:42AM

Hello all,

I have downloaded the 5.03 version and I'm having a hard time on this. I have 2 tables(alpha , beta) I want a trigger on alpha that verify a varchar field if it is = "BETA" then it should be insert to database BETA. Is it possible using trigger???

This is what I thought about, but it isnt working:

create trigger tr_alarme BEFORE INSERT on ALPHA
FOR EACH ROW
BEGIN
IF NEW.name = "ALARM" THEN
insert into beta (name) values (new.name);
END IF;
END//

Thanks for your help.

Options: ReplyQuote


Subject
Views
Written By
Posted
INSERT and DELETE on trigger
5655
March 29, 2005 06:42AM
2811
March 29, 2005 07:28AM
2678
March 29, 2005 07:34AM
3133
March 29, 2005 04:22PM


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.