我是新手触发,有没有办法在databaseA.conference中有新记录时触发对databaseB.track conferenceid的输入?这就是我所做的,而且不起作用。
DELIMITER//
CREATE or replace TRIGGER insert_confer
after insert ON conference
for each row
begin
insertdatabaseb.Track(:new.conferenceid);
end;
/
DatabaseA Database B
Conference Track
-conferenceid -Trackid
-conferencename -Trackname
-conferencevenue -Conferenceid
答案 0 :(得分:1)
问题不是触发器本身,而是insert
上的语法。也许:
DELIMITER//
CREATE or replace TRIGGER insert_confer
after insert ON conference
for each row
begin
insert into databaseb.Track(conferenceid)
values (:new.conferenceid);
end//
DELIMITER ;