on 2013 Oct 09 1:52 AM
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
Request clarification before answering.
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.