modsiw
asked on
DB2 and ON UPDATE CASCADE
Is there a DB2 counterpart of (version 7) of ON UPDATE CASCADE?
Example of my issue:
CREATE TABLE account_zipcode
(
account_id INTEGER NOT NULL,
zipcode VARCHAR(10) NOT NULL,
description VARCHAR(30) NOT NULL,
CONSTRAINT PK PRIMARY KEY (account_id, zipcode),
CONSTRAINT FK1 FOREIGN KEY (account_id) REFERENCES account(account_id)
)
CREATE TABLE account_zipcode_group
(
account_id INTEGER NOT NULL,
description VARCHAR(30) NOT NULL,
zipcode VARCHAR(10) NOT NULL,
CONSTRAINT PK PRIMARY KEY (account_id, description, zipcode),
CONSTRAINT FK1 FOREIGN KEY (account_id) REFERENCES account(account_id),
CONSTRAINT FK2 FOREIGN KEY (account_id, zipcode) REFERENCES account_zipcode(account_id , zipcode) ON UPDATE CASCADE
)
Example of my issue:
CREATE TABLE account_zipcode
(
account_id INTEGER NOT NULL,
zipcode VARCHAR(10) NOT NULL,
description VARCHAR(30) NOT NULL,
CONSTRAINT PK PRIMARY KEY (account_id, zipcode),
CONSTRAINT FK1 FOREIGN KEY (account_id) REFERENCES account(account_id)
)
CREATE TABLE account_zipcode_group
(
account_id INTEGER NOT NULL,
description VARCHAR(30) NOT NULL,
zipcode VARCHAR(10) NOT NULL,
CONSTRAINT PK PRIMARY KEY (account_id, description, zipcode),
CONSTRAINT FK1 FOREIGN KEY (account_id) REFERENCES account(account_id),
CONSTRAINT FK2 FOREIGN KEY (account_id, zipcode) REFERENCES account_zipcode(account_id
)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Is there a DB2(version 7) counterpart of ON UPDATE CASCADE?