2011-02-08 35 views
2

我試圖通過執行以下SQL語句來創建一個表檢查contraint:ORA-00907當試圖創建一個CHECK約束

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快捷 發佈10.2.0.1.0
  • 我執行 聲明使用網絡客戶端 (Application Express 2.1.0.00.39)
  • 數據庫用戶擁有DBA權限

謝謝!

回答

3

ErrorMessage是正確的!

小數錯過在年底< >在

CHECK (ValueType IN ('string', 'int', 'decimal, ... 
+1

呃...我絕對要休息一下。 :-( – Konamiman 2011-02-08 09:45:39

4

的錯誤信息是無用的,但你有一個語法錯誤 - 一個缺少單引號的位置:

'decimal,