MySQL Forums
Forum List  »  Views

Trigger insert into new database
Posted by: ace feehly
Date: July 09, 2011 11:56AM

I have two databases (testme,testyou). Each db has the same tables and structures. I have no control over modifications to db1. I created db2 and manually mysqldump db1 into it. Someone suggested I look into triggers to accomplish what I'm doing more efficiently. So I did the following test and it seemed to work:

mysql> use testme;
mysql> create trigger test_trig
-> after insert on testtbl1
-> FOR each row
-> insert into testtbl2 set comments=NEW.comments;
Query OK, 0 rows affected (0.09 sec)

This worked great for updating testtbl2 in the testme database. What I can't get to work is adding new entry into testtbl2 in the testyou database using the following:
mysql> use testme;
mysql> create trigger test_trig1
-> after insert on testtbl1
-> FOR each row
-> insert into testyou.testtbl2 set comments=NEW.comments;
ERROR 1235 (42000): This version of MySQL doesn't yet support 'multiple triggers
with the same action time and event for one table'

Appreciate any insight..

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger insert into new database
10146
July 09, 2011 11:56AM
3670
July 09, 2011 07:06PM


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.