creating trigger across different databases

后端 未结 3 1986
轮回少年
轮回少年 2021-01-14 21:25

Is there any way to create triggers on different databases? my requirement is like:-

 database: a1.db consist table: t1
 database:a2.db  consist table: t2
         


        
3条回答
  •  伪装坚强ぢ
    2021-01-14 22:00

    I can only speak for MySQL, but you should be able to do something like:

    CREATE TRIGGER ad_t1 AFTER DELETE ON `a1.db`.t1
    FOR EACH ROW
    INSERT INTO `a2.db`.t2 VALUES (...)
    

提交回复
热议问题