Home » RDBMS Server » Server Administration » Re: Deleting rows from multiple tables
Re: Deleting rows from multiple tables [message #370210] |
Tue, 10 November 1998 00:08 |
Paul Miller
Messages: 5 Registered: November 1998
|
Junior Member |
|
|
First, let me say that you cannot delete from more than one table with a single statement.
Second, and I'm not trying to be cute:
ALTER TABLE a ADD CONSTRAINT a_pk PRIMARY KEY (deptno);
ALTER TABLE b ADD CONSTRAINT b_a_fk FOREIGN KEY (deptno) REFERENCES a (deptno) ON DELETE CASCADE;
DELETE a WHERE deptno = 1234;
|
|
|
Goto Forum:
Current Time: Sat May 03 11:56:35 CDT 2025
|