SQL: composite primary key, constraint on cascade
I have 3 tables: A, B, C.
The table A contains the attributes: a (primary key)
The table A contains the attributes: a, c (both of them compose a
composite primary key)
The table A contains the attributes: c (primary key)
How should I set a constraint to remove the elements of B on cascade, when
I remove an entry in A? (using Oracle DBMS).
I have tried this:
ALTER TABLE A ADD CONSTRAINT constraint FOREIGN KEY (a) REFERENCES B (a)
ON DELETE CASCADE
But next error is thrown:
ORA-02270: no matching unique or primary key for this column-list
Thanks
No comments:
Post a Comment