Question: I am getting the ORA-01981
error. The table has a foreign key with a
references keyword.
Answer: The oerr utility shows this for the
ORA-01981 error:
ORA-01981 -
CASCADE CONSTRAINTS must be specified to perform this
revoke
Cause:
During this revoke some foreign key constraints
will be removed. In order to perform this automatically,
CASCADE CONSTRAINTS must be specified.
Action: Remove the constraints or specify
CASCADE CONSTRAINTS
Foreign key constraints help
to enforce the types of relationships between tables we
have just demonstrated. In this example we will create
the ITEM and PART table. In the process of doing so, we
will create a foreign key relationship between the two:
CREATE TABLE part(
Part_no NUMBER PRIMARY KEY,
Part_desc VARCHAR2(200) NOT NULL );
CREATE TABLE item (
Item_no NUMBER,
Part_no NUMBER,
Item_desc varchar2(200) NOT NULL,