Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: please help
On Tue, 15 Dec 1998 10:41:07 -0800, Steven <koh_cc_at_pacific.net.sg>
wrote:
>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.
>
>
Hi, Steven,
try the following:
ALTER TABLE child_table
ADD ( FOREIGN KEY (filed1) REFERENCES parent_table ON DELETE CASCADE )
In this example the field 'field1' must be present also in the parent-table.
Have a nice day!
Andreas Schlager
aschlager_at_kaindl.com
Received on Tue Dec 15 1998 - 04:24:03 CST