ORA-00907 when trying to create a CHECK constraint

487 Views Asked by At

I am trying to create a check contraint on a table by executing the following SQL statement:

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

but I get the following error:

ORA-00907: Missing right parenthesis

I am completely lost. What am I doing wrong?

Additional information:

  • The ApplicationConfiguration table exists and has a column of type nvarchar(32) not null named ValueType
  • Database is Oracle 10g Express Release 10.2.0.1.0
  • I am executing the statement by using the web client (Application Express 2.1.0.00.39)
  • The database user has DBA rights

Thank you!

2

There are 2 best solutions below

1
On BEST ANSWER

The Errormessage is right!

decimal misses a <'> at the End in

CHECK (ValueType IN ('string', 'int', 'decimal, ...
0
On

The error message is unhelpful, but you do have a syntax error - a missing single-quote here:

'decimal,