Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Kindly Help
Steven schrieb:
>
> hi,
>
> l have two exiting Parent and Child tables.
>
> May l know what's the actual command for me to use at SQL
> worksheet,
> in order to make them "on cascade delete" ?
>
> Purpose: when l deleted the parent table's record, the child
> table's record
> will be deleted as well.
>
You've got to setup a foreign key constraint with the cascade option and oracle will make all the work for you:
ALTER TABLE emp
ADD CONSTRAINT fk_deptno
REFERENCES dept(deptno) ON DELETE CASCADE
Always log on the bright side of life.
http://www.stone-dead.asn.au/movies/life-of-brian/brian-31.htm
Received on Tue Dec 15 1998 - 01:15:34 CST
![]() |
![]() |