Oracle 默认列值计算日期
我正在尝试创建一个表,该表的日期默认值为 sysdate - 2 在 oracle 中
Oracle 似乎可以使用 sysdate 作为默认值,但不能使用 sysdate - 2。这可能吗?
I am trying to create a table that has a default value for a date that is sysdate - 2 in oracle
Oracle seems to be fine with sysdate as the default but not sysdate - 2. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在括号中指定默认值:
创建表:
插入一条记录来测试默认值:
从表中选择数据以确认默认值有效(当前日期 14/11/2011):
DB 版本 10g。
希望它有帮助...
You need to specify the DEFAULT value in brackets:
Create the table:
Insert a record to test the default:
Select the data from the table to confirm the default worked (Current date 14/11/2011):
DB Version 10g.
Hope it helps...