Inline constraints

2025-10-09 03:34:24  Updated

This article introduces the supported conversion scope for inline constraints of CREATE TABLE DDL when migrating data from an Oracle database to OceanBase Database's Oracle compatible mode.

Syntax

Syntax of inline_constraint:

[ CONSTRAINT constraint_name ]
{ [ NOT ] NULL
| UNIQUE
| PRIMARY KEY
| references_clause
| CHECK (condition)
}
[ constraint_state ]

references_clause:
REFERENCES [ schema_name. ] object [ (column [, column ]...) ]
  [ON DELETE { CASCADE | SET NULL } ]

constraint_state:
[ [NOT] DEFERRABLE [INITIALLY {IMMEDIATE | DEFERRED}] ]
 |  INITIALLY { IMMEDIATE | DEFERRED } [ NOT ] [ DEFERRABLE ]
]
[  RELY | NORELY  ]
[ using_index_clause ]
[ ENABLE | DISABLE ]
[ VALIDATE | NOVALIDATE ]
[ exceptions_clause ]

Supported operations

  • Defining constraint names by using the CONSTRAINT constraint_name clause is supported.

  • Specify the NULL or NOT NULL attribute.

  • Specifying the UNIQUE and PRIMARY KEY constraints is supported.

Unsupported operations

  • Specifying the CHECK constraint is not supported. This option will be ignored.

  • Defining the foreign key by using the references_clause clause is not supported. This clause will be ignored.

  • Specifying the constraint state by using the constraint_state option is not supported. This option will be ignored.

Contact Us