V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nimonew
V2EX  ›  数据库

mysql 触发器能设置动态表名吗?

  •  
  •   nimonew · Nov 14, 2016 · 1159 views
    This topic created in 3463 days ago, the information mentioned may be changed or developed.

    需要在一个表插入数据时,在另一个表也插入数据,另一个表的表名是根据前一个表的一个字段计算出来的,这个有办法实现吗?

    3 replies    2016-11-14 18:12:09 +08:00
    laoyur
        1
    laoyur  
       Nov 14, 2016   ❤️ 1
    可以的,参考这个项目: https://github.com/ptorba/mysql-history
    nimonew
        2
    nimonew  
    OP
       Nov 14, 2016
    @laoyur 好的,我看看,谢谢
    laoyur
        3
    laoyur  
       Nov 14, 2016
    @x537196 可以看一下我以前的一篇文章,可能对你写触发器方面有点帮助 https://laoyur.com/archives/171
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1332 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 17:35 · PVG 01:35 · LAX 10:35 · JFK 13:35
    ♥ Do have faith in what you're doing.