【发布时间】:2020-10-06 09:19:12
【问题描述】:
我想在表格中添加一个称为类别的列,但我尝试了几个选项,但都不起作用
alter table attachments
add
(
category varchar2(20) not null check (category in ('default','agreement','security','information') DEFAULT 'default')
);
我也尝试过这样的事情
ALTER TABLE attachments
ADD category ENUM ('default','agreement','security','information') DEFAULT 'default'
我在这里查看了几篇帖子,但找不到任何解决方案。我在哪里犯错了?这里有什么问题? 我收到消息
Error report -
ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
【问题讨论】:
-
ENUM是 MySQL 语法,在 Oracle 中无效。 -
是的,我只看到文档。谢谢
标签: sql oracle alter-table check-constraints