2

我正在尝试通过执行以下 SQL 语句在表上创建检查约束:

alter table "ApplicationConfiguration" add
constraint APPLICATIONCONFIGURATION_CK1
CHECK (ValueType IN ('string', 'int', 'decimal, 'date', 'time', 'datetime', 'binary'))

但我收到以下错误:

ORA-00907: Missing right parenthesis

我完全迷路了。我究竟做错了什么?

附加信息:

  • ApplicationConfiguration表存在并且具有 nvarchar(32) not null名为的类型的列ValueType
  • 数据库是 Oracle 10g Express Release 10.2.0.1.0
  • 我正在使用 Web 客户端 (Application Express 2.1.0.00.39) 执行该语句
  • 数据库用户具有 DBA 权限

谢谢!

4

2 回答 2

4

错误消息没有帮助,但您确实有语法错误 - 此处缺少单引号:

'decimal,
于 2011-02-08T09:45:38.243 回答
3

错误信息是正确的!

十进制在末尾缺少 < ' >

CHECK (ValueType IN ('string', 'int', 'decimal, ...
于 2011-02-08T09:42:29.990 回答