Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cascade DELETE
Uhhh...I think you answered your own question. When you create the foreign key between the tables, specify ON CASCADE DELETE. Then, when you delete a record from the parent table, the child records will also be deleted.
On 29 Jan 98 17:42:55 GMT, "miguel" <jmiguel_at_cet.pt> wrote:
>Hi,
>
>Tables EMP(DEPTNO,DNAME) and DEPT(DEPTNO,ENAME) with the column EMP.DEPTNO
>referencing DEPT.DEPTNO.
>
>Is it possible, in one SQL statment, to delete rows from the child table
>when i delete the referenced row in the parent table? I´m searching an
>alternative to triggers.Which is the best choice?
>
>Thanks
>Miguel
Received on Thu Jan 29 1998 - 00:00:00 CST