Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的表格中,我想将一列的默认值设置为从现在起 30 天。这需要是一个真实的,而不是计算的列。就像是
alter table T_NAME alter column EXPIRATION set default CURRENT_TIMESTAMP + 2592000
无效,但你明白了。我确信我可以使用插入前触发器来做到这一点,但我只是想知道在默认子句中是否有一个我不知道的算术技巧。
我的数据库是火鸟 2.1.2
我认为没有,因为语言参考为CREATE TABLE和ALTER TABLE提供了:
[默认{字面| 空 | 用户}]
我想触发器确实是你唯一的选择。