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;
Previous Topic: Re: which database am i connected
Next Topic: Re: where to find Sql, PL/Sql lex & yacc grammar
Goto Forum:
  


Current Time: Sun Oct 25 09:36:12 CDT 2020