• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3268
  • 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

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

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