0

There are two tables test_1 and test_2. While creating test_2 table with in UPDATE CASCADE constraint. It gives me error. any solution ?

Create table test_1(
   test_id numeric(10) NOT NULL, 
   test_name VARCHAR2(20),
   CONSTRAINT test_pk PRIMARY KEY(test_id),
   CONSTRAINT test_UQ UNIQUE(test_name));

CREATE TABLE test_2(
   test_id1 numeric(20) NOT NULL, 
   test_name VARCHAR2(20),
   CONSTRAINT test2_pk PRIMARY KEY(test_id1),
   CONSTRAINT test2_FK FOREIGN KEY(test_name) 
          REFERENCES test_1(test_name) ON DELETE CASCADE ON UPDATE CASCADE
);
Jorge Campos
  • 22,647
  • 7
  • 56
  • 87
  • you may refer this : https://stackoverflow.com/questions/1481476/when-to-use-on-update-cascade/1481524 – Barbaros Özhan Mar 27 '18 at 03:30
  • Oracle does not support ON UPDATE CASCADE . [ Documentation ] https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/constraint.html#GUID-1055EA97-BA6F-4764-A15F-1024FD5B6DFE [ SIMILAR QUESTION ] https://dba.stackexchange.com/questions/199327/foreign-key-problem-ora-00907-missing-right-parenthesis-on-creating-table-or – stefan Mar 27 '18 at 05:57

0 Answers0