Subject | Re: [ib-support] Cascading Updates and Deletes? |
---|---|
Author | Giovani A |
Post date | 2002-11-06T19:16:48Z |
Hi, Darin!
You have to create a constraint for the detail table and set update and delete cascade.
Example: You have a MASTER table and a DETAIL table.
CREATE TABLE MASTER(
IDMASTER INTEGER NOT NULL,
FIELDA VARCHAR(10),
CONSTRAINT PKMASTER PRIMARY KEY(ID)
);
CREATE TABLE DETAIL(
IDMASTER INTEGER NOT NULL,
IDDETAIL INTEGER NOT NULL,
CONSTRAINT PKDETAIL PRIMARY KEY(IDMASTER, IDDETAIL)
);
ALTER TABLE DETAIL ADD CONSTRAINT FKDETAIL_MASTER FOREIGN KEY(IDMASTER) REFERENCES MASTER(IDMASTER) ON UPDATE CASCADE ON DELETE CASCADE;
I hope I can help you...
Regards,
Giovani.
You have to create a constraint for the detail table and set update and delete cascade.
Example: You have a MASTER table and a DETAIL table.
CREATE TABLE MASTER(
IDMASTER INTEGER NOT NULL,
FIELDA VARCHAR(10),
CONSTRAINT PKMASTER PRIMARY KEY(ID)
);
CREATE TABLE DETAIL(
IDMASTER INTEGER NOT NULL,
IDDETAIL INTEGER NOT NULL,
CONSTRAINT PKDETAIL PRIMARY KEY(IDMASTER, IDDETAIL)
);
ALTER TABLE DETAIL ADD CONSTRAINT FKDETAIL_MASTER FOREIGN KEY(IDMASTER) REFERENCES MASTER(IDMASTER) ON UPDATE CASCADE ON DELETE CASCADE;
I hope I can help you...
Regards,
Giovani.
----- Original Message -----
From: dvanatta
To: ib-support@yahoogroups.com
Sent: Wednesday, November 06, 2002 12:51 PM
Subject: [ib-support] Cascading Updates and Deletes?
Does Firebird have Cascade Update Releated Fields and Cascade Delete
Related Fields like MS SQL Server?
- Darin
Yahoo! Groups Sponsor
ADVERTISEMENT
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]