The forum will be down for scheduled maintenance on Saturday, March 4 beginning at 10am EST. Actual downtime is unknown but may be several hours.
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

asked 09 Oct '13, 00:52

mfkpie8's gravatar image

mfkpie8
86414651
accept rate: 10%

edited 09 Oct '13, 01:04

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×90

question asked: 09 Oct '13, 00:52

question was seen: 1,707 times

last updated: 09 Oct '13, 01:04