column_constraint_clause
The following is the syntax for the column_constraint_clause in the ALTER TABLE statement:
{ [NULL | NOT NULL] | [UNIQUE | PRIMARY KEY] | [FOREIGN KEY (column
[,column
...] )] [REFERENCES [schema
.]table_name
[(column
)] [ON DELETE CASCADE] ] [CHECK (condition
) ] } [USING INDEX [PCTFREEinteger
] [PCTUSEDinteger
] [INITRANSinteger
] [MAXTRANSinteger
] [TABLESPACEtablespace_name
] [STORAGE ( [INITIALinteger
[K | M]] [NEXTinteger
[K | M]] [MINEXTENTSinteger
[K | M]] [MAXEXTENTS {integer
| UNLIMITED}] [PCTINCREASEinteger
] [FREELISTSinteger
] [FREELIST GROUPSinteger
] ) [NOSORT] [LOGGING | NOLOGGING] ] [EXCEPTIONS INTO [schema.
]table_name
] [{ENABLE [VALIDATE | NOVALIDATE] | DISABLE} ] [[NOT] DEFERRABLE [INITIALLY {IMMEDIATE | DEFERRED}] ] [[INITIALLY {IMMEDIATE | DEFERRED}] [[NOT] DEFERRABLE] ]
- NULL
Specifies that the values in the column list may contain NULL.
- NOT NULL
Specifies that the values in the column may not contain NULL.
- UNIQUE
Specifies that the column list must be unique.
- PRIMARY KEY
Specifies that the column list will be a primary key. A primary key can be referenced from another table with a foreign key. A primary key must also be UNIQUE and NOT NULL.
- FOREIGN KEY
Requires that all values in the column list must be either NULL or found in the referenced table’s defined primary key or the specified column list.
- REFERENCES
Specifies the table that is referenced.
- ON DELETE CASCADE
Specifies that any deletes to the referenced table are propagated down to this table ...
Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.