• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3398
  • Last Modified:

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
)
0
modsiw
Asked:
modsiw
1 Solution
 
modsiwAuthor Commented:
woops, first line should read

Is there a DB2(version 7) counterpart of ON UPDATE CASCADE?
0
 
db2inst1Commented:
I don't think there is one for update. May be you can create a "on update trigger" to manually do this.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now