Restrictions on Foreign Key Constraints
Foreign key constraints are subject to the following restrictions:
•None of the columns in the foreign key can be of LOB, LONG, LONG RAW, VARRAY, NESTED TABLE, BFILE, REF, TIMESTAMP WITH TIME ZONE, or user-defined type. However, the primary key can contain a column of TIMESTAMP WITH LOCAL TIME ZONE.
•The referenced unique or primary key constraint on the parent table or view must already be defined.
•A composite foreign key cannot have more than 32 columns.
•The child and parent tables must be on the same database. To enable referential integrity constraints across nodes of a distributed database, you must use database triggers. See CREATE TRIGGER.
•If either the child or parent object is a view, then the constraint is subject to all restrictions on view constraints. See "View Constraints".
•You cannot define a foreign key constraint in a CREATE TABLE statement that contains an AS subquery clause. Instead, you must create the table without the constraint and then add it later with an ALTER TABLE statement.
Partager