cancel
Showing results for 
Search instead for 
Did you mean: 

cascading update

ximen
Participant
0 Kudos
3,127
CREATE TABLE test1 (id INTEGER PRIMARY KEY);
CREATE TABLE test2 (id2 INTEGER PRIMARY KEY, id INTEGER, FOREIGN KEY id(id) REFERENCES test1(id) ON UPDATE CASCADE ON DELETE CASCADE);

insert into test1(id)values(1);
insert into test2(id2,id)values(1,1);
delete from test1;

Could you tell me if write cascading update statement When ID to update the inside of the other database has been updated

Q2: When I update, or delete the primary key table, then the external key table will follow update, or delete together, need to set cascade properties when the table was being built

Accepted Solutions (0)

Answers (0)