Link to home
Create AccountLog in
Avatar of modsiw
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
)
Avatar of modsiw
modsiw

ASKER

woops, first line should read

Is there a DB2(version 7) counterpart of ON UPDATE CASCADE?
ASKER CERTIFIED SOLUTION
Avatar of db2inst1
db2inst1
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer