Sybase 空日期时间

Sybase null datetime

我试图在 table 中插入一行,同时保留两个日期时间列为空。

错误(对于两列):

The column column_name in table conflict does not allow null values.

table table 的唯一约束是主键约束。约束不在日期时间列上。

Sybase 中的日期时间可以为空吗?

您可以尝试将 NULL 值转换为日期时间数据类型,看看是否可行。

例如:

INSERT INTO tbl_conflict (date_column) VALUES (CAST(NULL AS datetime))

我没有意识到 Sybase 默认的列不为空。我需要将列设置为空。