• 请不要在回答技术问题时复制粘贴 AI 生成的内容
jackblack369
V2EX  ›  程序员

oracle 设置当更新一条记录时,实现更新字段的自动更新为当前时间

  •  
  •   jackblack369 ·
    jackblack369 · Dec 24, 2018 · 4780 views
    This topic created in 2695 days ago, the information mentioned may be changed or developed.

    除了可以编写触发器来实现外,有没有类似 mysql 中设置更新时间字段属性为CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,来实现时间字段的自动更新呢?

    2 replies    2018-12-24 16:28:22 +08:00
    hhhzccc
        1
    hhhzccc  
       Dec 24, 2018
    加一个时间字段 update_time 啊。update xxx set xx='',update_time=sysdate where xxx。。。
    heraldic
        2
    heraldic  
       Dec 24, 2018
    感觉只有触发器是最省心的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   948 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 21:29 · PVG 05:29 · LAX 14:29 · JFK 17:29
    ♥ Do have faith in what you're doing.